Здравствуйте! Имею на сервере нижеприведенную конфигурацию:
# /etc/hosts.allow
#
ALL: 127.0.0.1
ssh: 31.41.135.249
ssh: 192.168.0.12
ssh: ALL: spawn date >> /var/log/hosts.allow.log; /bin/echo from %a [%c] \
attempted to access %d >> /var/log/hosts.allow.log
# /etc/ssh/sshd_config
#
Port 22
Protocol 2
SyslogFacility AUTHPRIV
LogLevel INFO
PermitRootLogin no
AllowUsers bsm
StrictModes yes
IgnoreRhosts yes
PermitEmptyPasswords no
PasswordAuthentication yes
ChallengeResponseAuthentication no
GSSAPIAuthentication yes
GSSAPICleanupCredentials yes
UsePAM yes
AllowTcpForwarding no
X11Forwarding no
UsePrivilegeSeparation yes
ClientAliveInterval 900
ClientAliveCountMax 0
PidFile /var/run/sshd.pid
Banner /home/bsm/working/banner-sshd.txt
Subsystem sftp /usr/libexec/openssh/sftp-server
[root@maestro ~]# /etc/init.d/sshd start
Запускается sshd: [ ОК ]
[root@maestro ~]# /etc/init.d/sshd status
sshd (pid 26621) выполняется...
[root@maestro ~]# ps ax | grep ssh
26621 ? Ss 0:00 /usr/sbin/sshd
26696 pts/1 S+ 0:00 grep ssh
[root@maestro tmp]# netstat -lp | grep ss
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 server-kb:netbios-ssn *:* LISTEN 27997/smbd
tcp 0 0 localhost:netbios-ssn *:* LISTEN 27997/smbd
tcp 0 0 *:ssh *:* LISTEN 7351/sshd
unix 2 [ ACC ] STREAM LISTENING 814190 9872/gnome-session /tmp/.ICE-unix/9872
unix 2 [ ACC ] STREAM LISTENING 5971 2717/spamass-milter /var/run/spamass-milter/spamass-milter.sock
unix 2 [ ACC ] STREAM LISTENING 813988 9872/gnome-session /tmp/orbit-root/linc-2690-0-2360715f74275
ssh: connect to host 192.168.0.1 port 22: Connect time out
[root@maestro tmp]# netstat -lpnA inet | sort
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
raw 0 0 0.0.0.0:1 0.0.0.0:* 7 2641/dhcpd
raw 0 0 0.0.0.0:17 0.0.0.0:* 7 3024/portsentry
raw 0 0 0.0.0.0:6 0.0.0.0:* 7 3021/portsentry
raw 3632 0 0.0.0.0:1 0.0.0.0:* 7 2889/lisa
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2066/portmap
tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN 22498/pptpd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2519/vsftpd: LISTEN
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 2498/xinetd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2615/mysqld
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 9847/X
tcp 0 0 0.0.0.0:7741 0.0.0.0:* LISTEN 2889/lisa
tcp 0 0 10.10.1.4:25 0.0.0.0:* LISTEN 22615/sendmail: acc
tcp 0 0 127.0.0.1:139 0.0.0.0:* LISTEN 27997/smbd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 22615/sendmail: acc
tcp 0 0 127.0.0.1:445 0.0.0.0:* LISTEN 27997/smbd
tcp 0 0 127.0.0.1:50000 0.0.0.0:* LISTEN 2459/hpiod
tcp 0 0 127.0.0.1:50002 0.0.0.0:* LISTEN 2465/python
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 2023/named
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN 2429/mDNSResponder
tcp 0 0 127.0.0.1:783 0.0.0.0:* LISTEN 2673/spamd.pid
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 2023/named
tcp 0 0 192.168.0.1:139 0.0.0.0:* LISTEN 27997/smbd
tcp 0 0 192.168.0.1:25 0.0.0.0:* LISTEN 22615/sendmail: acc
tcp 0 0 192.168.0.1:3128 0.0.0.0:* LISTEN 20874/(squid)
tcp 0 0 192.168.0.1:445 0.0.0.0:* LISTEN 27997/smbd
tcp 0 0 192.168.0.1:53 0.0.0.0:* LISTEN 2023/named
udp 0 0 0.0.0.0:111 0.0.0.0:* 2066/portmap
udp 0 0 0.0.0.0:123 0.0.0.0:* 31846/ntpd
udp 0 0 0.0.0.0:137 0.0.0.0:* 28001/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 28001/nmbd
udp 0 0 0.0.0.0:3130 0.0.0.0:* 20874/(squid)
udp 0 0 0.0.0.0:3401 0.0.0.0:* 20874/(squid)
udp 0 0 0.0.0.0:38163 0.0.0.0:* 20874/(squid)
udp 0 0 0.0.0.0:53 0.0.0.0:* 2023/named
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2429/mDNSResponder
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2429/mDNSResponder
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2429/mDNSResponder
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2429/mDNSResponder
udp 0 0 0.0.0.0:67 0.0.0.0:* 2641/dhcpd
udp 0 0 0.0.0.0:7741 0.0.0.0:* 2889/lisa
udp 0 0 10.10.1.4:123 0.0.0.0:* 31846/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 31846/ntpd
udp 0 0 127.0.0.1:53 0.0.0.0:* 2023/named
udp 0 0 192.168.0.1:123 0.0.0.0:* 31846/ntpd
udp 0 0 192.168.0.1:137 0.0.0.0:* 28001/nmbd
udp 0 0 192.168.0.1:138 0.0.0.0:* 28001/nmbd
udp 0 0 192.168.0.1:53 0.0.0.0:* 2023/named
udp 0 0 192.168.0.2:123 0.0.0.0:* 31846/ntpd
..
Jan 14 11:22:08 maestro sshd[5945]: Server listening on :: port 22.
Jan 14 11:22:08 maestro sshd[5945]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 14 11:27:22 maestro sshd[5945]: Received signal 15; terminating.
Jan 14 11:27:30 maestro sshd[7351]: Server listening on :: port 22.
Jan 14 11:27:30 maestro sshd[7351]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 14 12:14:35 maestro sshd[23778]: refused connect from ::ffff:60.173.26.165 (::ffff:60.173.26.165)
Jan 14 12:55:46 maestro sshd[1723]: refused connect from old_server_kb (::ffff:192.168.0.12)
Jan 14 13:22:51 maestro sshd[14156]: refused connect from ::ffff:103.41.124.103 (::ffff:103.41.124.103)