ssh禁止在ipv6上监听

  1. root@localhost:~# netstat -nltp
  2. Active Internet connections (only servers)
  3. Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  4. tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      5866/sshd
  5. tcp6       0      0 :::22                   :::*                    LISTEN      5866/sshd
  6.  
  7. root@localhost:~# echo -ne '#ipv6 disallow\nAddressFamily inet\n' >> /etc/ssh/sshd_config
  8.  
  9. root@localhost:~# service ssh restart
  10. ssh stop/waiting
  11. ssh start/running, process 6208
  12. root@localhost:~# netstat -nltp
  13. Active Internet connections (only servers)
  14. Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  15. tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6208/sshd

强帖留名: