Linux SSH配置优化

1、SSH 在Linux下的配置文件

/etc/ssh/sshd_config

2、连接慢的优化修改配置文件/etc/ssh/sshd_config

UseDNS no
# GSSAPI options
GSSAPIAuthentication no
然后,执行/etc/init.d/sshd restart重启sshd进程使上述配置生效,在连接一般就不慢了;

如果还慢的话,检查ssh服务端上/etc/hosts文件中,127.0.0.1对应的主机名是否和
uname -n的结果一样,或者把本机ip和hostname(uname -n结果)加入到/etc/hosts里。

修改vim /etc/ssh/sshd_config;修改前先备份

Port  22113 修改默认端口

PermitRootlogin no  禁止root远程登陆(可选)

PermitEmptyPasswords no 禁止空密码登录

UserDNS no 不使用DNS

GSSAPIAuthentication no 公共安全事项接口(客服端登录会校验)

3、利用ssh-v的调试功能查找慢的原因

ssh -v [email protected] 调试连接慢的原因

猜你喜欢

转载自blog.csdn.net/LINU_BW/article/details/85222073
今日推荐