OpenSSH 升级脚本

时间 2021/5/20 21:54:23 加载中...

升级相关的脚本和文件在 gitee 下。
https://gitee.com/sqber/upgradeOpenSSH

这也是从 git 上拉取的别人的项目 https://github.com/whisshe/upgradeOpenSSH
项目中添加了最新的 OpenSSH 文件
openssh-8.6p1.tar.gz,位于 package 目录下。

准备(重要)

查看当前 OpenSSH 的版本,说明:我的旧版本是
[root@localhost upgradeOpenSSH]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017

其它版本不敢保证脚本能正常执行。

操作

将整个项目的文件拉取下来,然后上传到服务器。先对整个目录分配可执行的权限:

chmod 777 *

执行 ./upgradeOpenSSH
选择要升级的版本,回车即可

升级完毕后,最后的部分内容如下:

  1. /usr/bin/install -c -m 644 ssh-sk-helper.8.out /opt/openssh8.6p1/share/man/man8/ssh-sk-helper.8
  2. /usr/bin/mkdir -p /opt/openssh8.6p1/etc
  3. ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
  4. /opt/openssh8.6p1/sbin/sshd -t -f /opt/openssh8.6p1/etc/sshd_config
  5. make: 警告:检测到时钟错误。您的创建可能是不完整的。
  6. 注意:正在将请求转发到“systemctl enable sshd.socket”。
  7. Created symlink from /etc/systemd/system/sockets.target.wants/sshd.socket to /usr/lib/systemd/system/sshd.socket.
  8. sshd is already started

升级完毕后,执行 source /etc/profile.d/openssh.sh
或者重新开一个新的ssh连接
然后即可检查ssh是否升级成功
ssh -V

相关资源

openssh
https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/

openssl
https://ftp.openssl.org/source/

他山之石

https://blog.csdn.net/weixin_30653755/article/details/116629900
https://blog.csdn.net/weixin_40147410/article/details/106710587
https://www.cnblogs.com/wangyang0210/p/12552040.html

扫码分享
版权说明
作者:SQBER
文章来源:http://www.sqber.com/articles/openssh-upgrade-script.html
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。