OpenSSH9.8快速升级,CentOS7使用脚本一键快速升级至openssh9.8,连接无中断

IT运维老白 2024-07-15 09:07:06 阅读 77

OpenSSH9.8快速升级,CentOS7使用脚本一键快速升级至openssh9.8,连接无中断

本地测试环境CentOS7.4

<code>[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

确认当前openssh版本

[root@localhost ~]# ssh -V

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017

上传打包好的rpm包和执行脚本 http://121.37.180.195/p.php?8tp=s2.31475a8b9900.pg3

[root@localhost ~]# ls

openssh9.8rpm.tar.gz openssh.sh

执行脚本

[root@localhost ~]# bash openssh.sh

执行结果

openssh9.8rpm/openssh-9.8p1-1.el7.x86_64.rpm

openssh9.8rpm/openssh-askpass-9.8p1-1.el7.x86_64.rpm

openssh9.8rpm/openssh-askpass-gnome-9.8p1-1.el7.x86_64.rpm

openssh9.8rpm/openssh-clients-9.8p1-1.el7.x86_64.rpm

openssh9.8rpm/openssh-debuginfo-9.8p1-1.el7.x86_64.rpm

openssh9.8rpm/openssh-server-9.8p1-1.el7.x86_64.rpm

Preparing... ################################# [100%]

Updating / installing...

1:openssh-9.8p1-1.el7 ################################# [ 17%]

2:openssh-askpass-9.8p1-1.el7 ################################# [ 33%]

3:openssh-askpass-gnome-9.8p1-1.el7################################# [ 50%]

4:openssh-clients-9.8p1-1.el7 ################################# [ 67%]

5:openssh-server-9.8p1-1.el7 ################################# [ 83%]

6:openssh-debuginfo-9.8p1-1.el7 ################################# [100%]

ssh-keygen: generating new host keys: ED25519

● sshd.service - SYSV: OpenSSH server daemon

Loaded: loaded (/etc/rc.d/init.d/sshd; bad; vendor preset: enabled)

Active: active (running) since Mon 2036-08-04 17:12:47 CST; 137ms ago

Docs: man:systemd-sysv-generator(8)

Process: 1689 ExecStop=/etc/rc.d/init.d/sshd stop (code=exited, status=0/SUCCESS)

Process: 1696 ExecStart=/etc/rc.d/init.d/sshd start (code=exited, status=0/SUCCESS)

Main PID: 1704 (sshd)

CGroup: /system.slice/sshd.service

└─1704 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups

Aug 04 17:12:47 localhost.localdomain systemd[1]: Starting SYSV: OpenSSH server daemon...

Aug 04 17:12:47 localhost.localdomain sshd[1696]: /sbin/restorecon: lstat(/etc/ssh/ssh_host_rsa_key.pub) failed: No such file or...ectory

Aug 04 17:12:47 localhost.localdomain sshd[1696]: /sbin/restorecon: lstat(/etc/ssh/ssh_host_dsa_key.pub) failed: No such file or...ectory

Aug 04 17:12:47 localhost.localdomain sshd[1696]: /sbin/restorecon: lstat(/etc/ssh/ssh_host_ecdsa_key.pub) failed: No such file ...ectory

Aug 04 17:12:47 localhost.localdomain sshd[1704]: Server listening on 0.0.0.0 port 22.

Aug 04 17:12:47 localhost.localdomain sshd[1704]: Server listening on :: port 22.

Aug 04 17:12:47 localhost.localdomain sshd[1696]: Starting sshd:[ OK ]

Aug 04 17:12:47 localhost.localdomain systemd[1]: Started SYSV: OpenSSH server daemon.

Hint: Some lines were ellipsized, use -l to show in full.

OpenSSH_9.8p1, without OpenSS

验证结果

[root@localhost ~]# ssh -V

OpenSSH_9.8p1, without OpenSSL

已升级至openssh9.8,升级过程无需联网,升级不会中断远程,CentOS7.2、CentOS7.4、CentOS7.5、CentOS7.6、CentOS7.7、CentOS7.8、CentOS7.9已亲测可用。

rpm压缩包下载地址

http://121.37.180.195/p.php?8tp=s2.31475a8b9900.pg3

CentOS8升级openssh9.8请看另外一篇文章

https://blog.csdn.net/abc15138565332/article/details/140154613

说明

rpm包是个人通过官网源码包编译的,在本地操作系统测试过,完全一键安装,比较适合伸手党,但是时间也是有成本的,大神和介意的请绕过。

打包教程网上都有,介意的可以自行学习。



声明

本文内容仅代表作者观点,或转载于其他网站,本站不以此文作为商业用途
如有涉及侵权,请联系本站进行删除
转载本站原创文章,请注明来源及作者。