Ubuntu22.04.*升级OPENSSH9.*

 ·  2025-02-24

1、安装依赖包

sudo apt update
sudo apt install build-essential zlib1g-dev libssl-dev -y
sudo apt install autoconf -y

2、创建sshd文件夹

sudo mkdir /var/lib/sshd
sudo chmod -R 700 /var/lib/sshd/
sudo chown -R root:sys /var/lib/sshd/

3、下载OPENSSH9.9(下载地址:https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/

sudo -i
cd /var/lib/sshd/
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz

4、解压安装

sudo tar -zxf openssh-9.9p1.tar.gz
cd openssh-9.9p1/
sudo autoreconf
sudo apt install libpam0g-dev libselinux1-dev libkrb5-dev -y
sudo ./configure --with-kerberos5 --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --sysconfdir=/etc/ssh
sudo make
sudo make install

5、重启 SSH

sudo systemctl restart ssh
sudo systemctl status ssh
ssh -V
sshd -v
 
评论
Jan. All Rights Reserved. Theme Jasmine by Kent Liao.
蜀ICP备2023017538号-1