一、文档相关
二、升级操作
1. 查看 openssh和openssl 版本
sshd -V
2. 下载解压
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.7p1.tar.gz
tar -zxvf openssh-9.7p1.tar.gz
3. 构建环境、编译和安装
sudo apt-get update
sudo apt-get install zlib1g-dev libpam0g-dev
cd openssh-9.7p1
./configure --prefix=/usr/local/openssh97p1 --sysconfdir=/etc/ssh --with-pam --with-zlib
make && make install
4. 将必要的文件复制到合适的位置
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
cp /usr/local/openssh97p1/etc/sshd_config /etc/ssh/sshd_config
cp /usr/local/openssh97p1/sbin/sshd /usr/sbin/sshd
cp /usr/local/openssh97p1/bin/ssh /usr/bin/ssh
cp /usr/local/openssh97p1/bin/ssh-keygen /usr/bin/ssh-keygen
5. 编辑 SSH 配置文件, 重启 SSH 服务
注意:/etc/ssh/sshd_config:
PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes
systemctl restart sshd
sshd -V
标签:sshd,openssh,升级,etc,ssh,cp,usr
From: https://blog.csdn.net/qq_36291550/article/details/144293351