分享记录一下,之前升级到openssh8.4p1版本时,遇见的问题,供后期查阅。
系统版本:
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
openssh升级前版本:
[root@localhost ~]# ssh -V
OpenSSH_8.1p1, OpenSSL 1.0.2q 20 Nov 2018
升级到openssh8.4p1
软件包:
升级步骤:
[root@localhost ~]# rpm -qa| grep openssh
openssh-askpass-5.3p1-94.el6.x86_64
openssh-5.3p1-94.el6.x86_64
openssh-server-5.3p1-94.el6.x86_64
openssh-clients-5.3p1-94.el6.x86_64
[root@localhost ~]# rpm -e --nodeps openssh-askpass-5.3p1-94.el6.x86_64
[root@localhost ~]# rpm -e --nodeps openssh-5.3p1-94.el6.x86_64
[root@localhost ~]# rpm -e --nodeps openssh-server-5.3p1-94.el6.x86_64
[root@localhost ~]# rpm -e --nodeps openssh-clients-5.3p1-94.el6.x86_64
[root@localhost ~]# mv /etc/ssh /etc/ssh.old
-
解压软件包,生成如下文件:
[root@localhost x86_64]#
ls
openssh-8.4p1-1.el6.x86_64.rpm openssh-server-8.4p1-1.el6.x86_64.rpm ssh.repo
openssh-clients-8.4p1-1.el6.x86_64.rpm repodata
2、准备ssh.repo源
[root@localhost x86_64]# cp ssh.repo /etc/yum.repos.d/ssh.repo
[root@localhost x86_64]# cat /etc/yum.repos.d/ssh.repo
[ssh]
name=ssh
baseurl=file:///tmp/x86_64
gpgcheck=0
enabled=1
[root@localhost x86_64]# cd ..
[root@localhost opt]# mv x86_64 /tmp/
[root@localhost opt]# yum clean all
[root@localhost opt]# yum makecache fast
3、进行安装
[root@localhost opt]# yum install -y openssh openssh-server openssh-clients -
安装完成之后的版本
[root@localhost opt]#
ssh -V
OpenSSH_8.4p1, OpenSSL 1.0.2q 20 Nov 2018
注意事项:
ssh/sshd命令的环境变量问题。
解决办法:
[root@localhost ~]# which ssh
/usr/local/bin/ssh
[root@localhost ~]# which sshd
/usr/local/sbin/sshd
[root@localhost ~]# mv /usr/local/bin/ssh /usr/local/bin/ssh.bak
[root@localhost ~]# mv /usr/local/sbin/sshd /usr/local/sbin/sshd.bak
[root@localhost ~]# cp /usr/sbin/sshd /usr/local/sbin/sshd
[root@localhost ~]# cp /usr/bin/ssh /usr/local/bin/ssh
[root@localhost ~]# ssh -V
OpenSSH_8.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013
[root@localhost ~]# sshd -V
unknown option -- V
OpenSSH_8.4p1, OpenSSL 1.0.1e-fips 11 Feb 2013
usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]
[-E log_file] [-f config_file] [-g login_grace_time]
[-h host_key_file] [-o option] [-p port] [-u len]
后期:openssh升级步骤.附
https://cikeblog.com/tag/openssh
在此,感谢他的贡献!
作者:岁月星空
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。