第一步:编辑ssh服务端配置文件
vi
/etc
/ssh
/sshd_config
ListenAddress 10.0.0.23:
22
ListenAddress 202.106.0.20: 2012
ListenAddress 202.106.0.20: 2012
第二步:重启ssh,并检查端口是否开启
/etc
/init.d
/sshd restart
netstat
-lntp
tcp 0 0 202.106.0.20: 2012 0.0.0.0: * LISTEN 31702 /sshd
tcp 0 0 10.0.0.23: 22 0.0.0.0: * LISTEN 31702 /sshd
tcp 0 0 202.106.0.20: 2012 0.0.0.0: * LISTEN 31702 /sshd
tcp 0 0 10.0.0.23: 22 0.0.0.0: * LISTEN 31702 /sshd
第三步:登录测试
在另一台外网机上通常外网telnet测试
telnet 202.106.0.20
2012
Trying 202.106.0.20...
Connected to 202.106.0.20.
Escape character is '^]'.
SSH- 2.0-OpenSSH_4.3
Trying 202.106.0.20...
Connected to 202.106.0.20.
Escape character is '^]'.
SSH- 2.0-OpenSSH_4.3
在10网段telnet测试
telnet 10.0.0.23
22
Trying 10.0.0.23...
Connected to 10.0.0.23.
Escape character is '^]'.
SSH- 2.0-OpenSSH_4.3
Trying 10.0.0.23...
Connected to 10.0.0.23.
Escape character is '^]'.
SSH- 2.0-OpenSSH_4.3
说明:此方法用于内网需22端口,但为安全外网启另一端口给SSH用,互不影响,从而对服务器安全做了进一步的加固!
转载请注明: 转载自http://www.elain.org
本文链接地址:SSH另类安全加固
本文转自 elain2012 51CTO博客,原文链接:http://blog.51cto.com/elain/699920