更新OpenSSH

centos7升级流程:https://www.fcblog.cn/post/29.html

以下使用于centos6

1.安装必要组件:

yum install -y gcc openssl-devel pam-devel rpm-build


2.下载OpenSSH最新版本:

https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/
在以上网站找到最新版链接并下载解压
wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz
tar -zxvf openssh-7.5p1.tar.gz

3.到openssh-7.5p1目录下编译并安装最新版OpenSSH:

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers
如果没报错则执行安装命令
make && make install

4.查看OpenSSH版本信息

ssh -V

5.修改配置

去掉此行#,如果想远程能够远程登录root用户
#PermitRootLogin yes

6.重启并处理异常

service sshd restart
如果出现以下异常
/etc/ssh/sshd_config line 81: Unsupported option GSSAPIAuthentication
/etc/ssh/sshd_config line 83: Unsupported option GSSAPICleanupCredentials
则注释掉相关行数即可。

原文地址:https://www.cnblogs.com/chenjw-note/p/10119285.html