一、问题描述
通过SecureCRT软件来连接服务器,可以连接成功,但是有报警,而且速度有些慢,经过查询发现是在连接 OpenSSH服务器的时候,假如 UseDNS选项是打开的话,服务器会先根据客户端的 IP地址进行 DNS PTR反向查询出客户端的主机名,然后根据查询出的客户端主机名进行DNS正向A记录查询,并验证是否与原始 IP地址一致,通过此种措施来防止客户端欺骗。平时我们都是动态 IP不会有PTR记录,所以打开此选项也没有太多作用。我们可以通过关闭此功能来提高连接 OpenSSH 服务器的速度。
二、故障处理
1.连接过程中报错
[oracle@db ~]$ ssh 10.10.100.6
Address 10.10.100.6 maps to bogon, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
Last login: Fri Mar 18 10:02:03 2016 from 10.10.102.38
[oracle@db2 ~]$
2.退出返回至当前主机
[oracle@db2 ~]$ exit
[oracle@db ~]$
[oracle@db ~]$ exit
logout
[root@db ~]#
3.修改sshd_config配置文件,共两处
[root@db ~]# cd /etc/ssh
[root@db ssh]# pwd
/etc/ssh
[root@db ssh]# ls
total 172
drwxr-xr-x. 2 root root 4096 Mar 18 14:51 .
drwxr-xr-x. 118 root root 12288 Mar 18 14:55 ..
-rw-------. 1 root root 125811 Dec 13 2012 moduli
-rw-r--r--. 1 root root 2047 Dec 13 2012 ssh_config
-rw------- 1 root root 3890 Mar 18 14:47
sshd_config
-rw-------. 1 root root 668 Oct 21 2012 ssh_host_dsa_key
-rw-r--r--. 1 root root 590 Oct 21 2012 ssh_host_dsa_key.pub
-rw-------. 1 root root 963 Oct 21 2012 ssh_host_key
-rw-r--r--. 1 root root 627 Oct 21 2012 ssh_host_key.pub
-rw-------. 1 root root 1671 Oct 21 2012 ssh_host_rsa_key
-rw-r--r--. 1 root root 382 Oct 21 2012 ssh_host_rsa_key.pub
4.将sshd_config中的GSSAPIAuthentiction yes 改成 no ,UseDNS yes 改成 no
[root@db ssh]# vi sshd_config
![](http://img.blog.itpub.net/blog/attachment/201603/18/26148431_1458289045NDk5.png?x-oss-process=style/bb)
![](http://img.blog.itpub.net/blog/attachment/201603/18/26148431_1458289045TJcp.png?x-oss-process=style/bb)
5.重启 OpenSSH服务器
[root@db ssh]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
6.再次登录,问题解决,速度也正常
[oracle@db ~]$ ssh 10.10.100.6
Last login: Fri Mar 18 15:19:07 2016 from 10.10.100.111
三、总结
此问题虽然暂时解决,但是对系统中的配置还是一知半解。希望对系统或网络感兴趣的朋友继续深入进去, 最好将该文件中的配置全部学习一下,并分享出来。
Where there's a will, there's a way.
Where there's a will, there's a way.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26148431/viewspace-2059604/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26148431/viewspace-2059604/