- 论坛徽章:
- 0
|
我在/etc/ssh/sshd_config中把端口改成23,同时禁止了telnet,如下:
#VersionAddendum FreeBSD-20061110
#Port 22
Port 23
#Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
改完后从23端口可能正常ssh,不过发现原22端口竟然还在,而且也可以正常登陆,
而且,我在/etc/inetd.conf中只开了ssh tcp4,为什么ssh tcp6也会自动开了??
$ netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.1.105.22 192.168.1.101.2837 ESTABLISHED
tcp4 0 52 192.168.1.105.23 192.168.1.101.2836 ESTABLISHED
tcp4 0 0 *.6160 *.* LISTEN
tcp4 0 0 *.22 *.* LISTEN
tcp4 0 0 127.0.0.1.25 *.* LISTEN
tcp4 0 0 *.23 *.* LISTEN
tcp6 0 0 *.23 *.* LISTEN
tcp4 0 0 *.* *.* CLOSED
tcp46 0 0 *.80 *.* LISTEN
tcp4 0 0 *.3306 *.* LISTEN
tcp4 0 0 *.139 *.* LISTEN
tcp4 0 0 *.445 *.* LISTEN
# $FreeBSD: src/etc/inetd.conf,v 1.73 2007/07/05 09:46:53 delphij Exp $
#
# Internet server configuration database
#
# Define *both* IPv4 and IPv6 entries for dual-stack support.
# To disable a service, comment it out by prefixing the line with '#'.
# To enable a service, remove the '#' at the beginning of the line.
#
#ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l
#ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l
#ftp stream tcp nowait root /usr/libexec/lukemftpd ftpd -l -r
#ftp stream tcp6 nowait root /usr/libexec/lukemftpd ftpd -l -r
ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
#ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i -6
#telnet stream tcp nowait root /usr/libexec/telnetd telnetd
#telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd
#shell stream tcp nowait root /usr/libexec/rshd rshd
#shell stream tcp6 nowait root /usr/libexec/rshd rshd
#login stream tcp nowait root /usr/libexec/rlogind rlogind
#login stream tcp6 nowait root /usr/libexec/rlogind rlogind
#finger stream tcp nowait/3/10 nobody /usr/libexec/fingerd fingerd -s
#finger stream tcp6 nowait/3/10 nobody /usr/libexec/fingerd fingerd -s
[ 本帖最后由 TCBY 于 2008-5-11 02:34 编辑 ] |
|