当前位置:   article > 正文

ubuntu下openssh升级_ubuntu升级openssh

ubuntu升级openssh

一、ubuntu下openssh升级

安装依赖

sudo apt update 更新库
sudo apt install zlib1g libpam0g-dev  libssl-dev
  • 1
  • 2

二、升级ssl,见本博客

https://blog.csdn.net/qq_42430287/article/details/125539316

三、升级openssh

备份原文件
mv /etc/init.d/ssh /etc/init.d/ssh.old
cp -r /etc/ssh /etc/ssh.old
# 卸载原openssh
apt-get remove openssh-server openssh-client
tar xf openssh-9.0p1.tar.gz
cd openssh-9.0p1 
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-ssl-dir=/usr/local/ssl --with-privsep-path=/var/lib/sshd
make 
make install 
查看版本
ssh -V
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

四、升级完成,更换配置文件

1. 修改默认配置文件

根据之前配置修改,保证配置相同

2. 也可使用原来的配置文件

cd /etc/ssh
mv sshd_config sshd_config.default
cp …/ssh.old/sshd_config ./

3.使用原来的/etc/init.d/ssh

mv /etc/init.d/ssh.old /etc/init.d/ssh

4.取消注销指定服务

systemctl unmask ssh

5.重启服务

systemctl restart ssh

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/845815?site
推荐阅读
相关标签
  

闽ICP备14008679号