请教:关于WINDOWS下用TELNET或FTP登录QNX

我的问题是,在使用Windows登录到服务器上QNX系统时,有没有什么办法(或什么软件)可任意指定端口。(比如说,当出于安全考虑把23端口封掉时)
望大侠指教!谢!
:stuck_out_tongue:

直接 telnet qnxip port_num 就可以了。

在QNX里怎么设置,不可能只在WINDOWS这边指端口罢?

改/etc/inetd.conf,telnet那一行,第一栏就是port号。

不好意思,我比较笨,没理解明白,打开文件后不知道怎么改,文档贴在下边,还烦唐先生指点。

@(#)inetd.conf 1.23 90/01/03 SMI

Configuration file for inetd(8). See inetd.conf(5).

To re-configure the running inetd process, edit this file, then

send the inetd process a SIGHUP.

Internet services syntax:

<service_name> <socket_type> <server_pathname>

Ftp and telnet are standard Internet services.

ftp stream tcp nowait root /usr/ucb/ftpd in.ftpd
telnet stream tcp nowait root /usr/ucb/telnetd in.telnetd

Tnamed serves the obolete IEN-116 name server protocol.

#name dgram udp wait root /usr/ucb/in.tnamed in.tnamed

Shell, login, exec, comsat and talk are BSD protocols.

shell stream tcp nowait root /usr/ucb/rshd in.rshd
login stream tcp nowait root /usr/ucb/rlogind in.rlogind
exec stream tcp nowait root /usr/ucb/rexecd in.rexecd
#comsat dgram udp wait root /usr/ucb/comsat in.comsat
#ntalk dgram udp wait root /usr/ucb/ntalkd in.ntalkd

Run as user “uucp” if you don’t want uucpd’s wtmp entries.

#uucp stream tcp nowait root /usr/ucb/in.uucpd in.uucpd

Tftp service is provided primarily for booting. Most sites run this

only on machines acting as “boot servers.”

tftp dgram udp wait bin /usr/ucb/tftpd in.tftpd

Finger, systat and netstat give out user information which may be

valuable to potential “system crackers.” Many sites choose to disable

some or all of these services to improve security.

#finger stream tcp nowait root /usr/ucb/fingerd fingerd
systat stream tcp nowait root /bin/ps ps -auwwx
netstat stream tcp nowait root /usr/ucb/netstat netstat -f inet

Time service is used for clock syncronization.

#time stream tcp nowait root internal
#time dgram udp wait root internal

Echo, discard, daytime, and chargen are used primarily for testing.

#echo stream tcp nowait root internal
#echo dgram udp wait root internal
#discard stream tcp nowait root internal
#discard dgram udp wait root internal
#daytime stream tcp nowait root internal
#daytime dgram udp wait root internal
#chargen stream tcp nowait root internal
#chargen dgram udp wait root internal

phrelay stream tcp nowait root /usr/photon/bin/phrelay phrelay
pop3 stream tcp nowait root /usr/ucb/popper popper

RPC services syntax:

<rpc_prog>/ <socket_type> rpc/

The mount server is usually started in /usr/ucb/rc.local only on machines that

are NFS servers. It can be run by inetd as well.

#mountd/1 dgram rpc/udp wait root /usr/ucb/mountd rpc.mountd

The rexd server provides only minimal authentication and is often not run

by sites concerned about security.

#rexd/1 stream rpc/tcp wait root /usr/ucb/rexd rpc.rexd

Ypupdated is run by sites that support NIS updating.

#ypupdated/1 stream rpc/tcp wait root /usr/ucb/ypupdated rpc.ypupdated

Rquotad serves UFS disk quotas to NFS clients.

#rquotad/1 dgram rpc/udp wait root /usr/ucb/rquotad rpc.rquotad

Rstatd is used by programs such as perfmeter.

#rstatd/2-4 dgram rpc/udp wait root /usr/usr/ucb/rstatd rpc.rstatd

The rusers service gives out user information. Sites concerned

with security may choose to disable it.

#rusersd/1-2 dgram rpc/udp wait root /usr/ucb/rusersd rpc.rusersd

The spray server is used primarily for testing.

#sprayd/1 dgram rpc/udp wait root /usr/ucb/sprayd rpc.sprayd

The rwall server lets anyone on the network bother everyone on your machine.

#walld/1 dgram rpc/udp wait root /usr/ucb/rwalld rpc.rwalld

TLI services syntax [not yet implemented]:

<service_name> tli <server_pathname>

TCPMUX services syntax [not yet implemented]:

tcpmux/<service_name> stream tcp <server_pathname>

ftp stream tcp nowait root /usr/ucb/ftpd in.ftpd
telnet stream tcp nowait root /usr/ucb/telnetd in.telnetd

把这两行改成:

8021 stream tcp nowait root /usr/ucb/ftpd in.ftpd
8023 stream tcp nowait root /usr/ucb/telnetd in.telnetd

然后重启inetd就可以了。这样ftp在端口8021上,telnet在端口8023上了。

谢谢唐先生!原先提的问题顺利解决.不过对为什么这么改,我还很疑惑,具体说就是:
inetd.conf里原说:

Internet services syntax:

<service_name> <socket_type> <server_pathname>

为什么可将<service_name> 代以端口号呢,原程序中的ftp代成8021,咋看起来变量类型就不对。联机文档里似乎也找不到关于怎么该端口的说法。望唐先生
能为解惑,netluck不胜感激!

/etc/services 定义了公认service name到端口号的转换。

还可以查看getprotobyname()函数getprotobynumber()函数getprotoent()函数。[/url]

读过这几个文档了,但并未找到哪句话说service name 可以整型值代,使作为端口号——也许我有某种常识性的无知,可又是什么呢?我是个本科学生,因生产实习接触到QNX才一周,提的问题也许比较幼稚,但本着“不耻下问”的精神,我还是提出来,望唐老师能为解答。

我再试试吧。 :laughing:

"端口号"原来定义就是一个16bit数字,就好象“IP地址”原来定义就是aaa.bbb.ccc.ddd一串数字一样。但是为了容易记,才想出了hostname.domain这样的字符串来表示。比如cn.openqnx.com,当然还有一套规则怎样把一个hostname.domain变换成一个aaa.bbb.ccc.ddd的IP地址。

"端口号“也是这样。为了易记,给公认的,和一些常用的端口号符了名,就是service name了。这样,程序可以通过名字来找端口号,而不是死记数字了。