环境:
系统版本:uos-server-20-1070a
openssh版本:8.2p1
openssl版本:1.1.1f
准备工作:
1.备份配置文件:
mkdir -p /bak
sudo cp -r /etc/ssh/* /bak
1
2
2.下载openssh-9.8p1.tar.gz
https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/
编译升级:
1.上传openssh压缩包
2.解压安装:
tar -zxvf openssh-9.8p1.tar.gz && cd openssh-9.8p1 && ./configure –prefix=/usr –sysconfdir=/etc/ssh && make && make install
1
3.拷贝回备份配置文件:
sudo cp -r /bak/* /etc/ssh
1
4.修改配置文件
sudo sed -i ‘s/Type=notify/Type=simple/g’ /usr/lib/systemd/system/sshd.service
cd /etc/ssh/
sshd -t #根据提示对配置文件行注释
1
2
3
sudo sed -i ‘/GSSAPIAuthentication/s/^/#/’ sshd_config
1
5.安装结束后检查/etc/ssh/sshd_config.d目录是否存在,如果不存在则需修改配置文件:
sudo sed -i ‘/GSSAPIKexAlgorithms/s/^/#/’ /etc/crypto-policies/back-ends/openssh.config #注释文件内GSSAPIKexAlgorithms开头的行。
sudo sed -i ‘/^# *CRYPTO_POLICY/s/^# *//’ /etc/sysconfig/sshd #取消配置文件中改行注释。
1
2
验证:
cd /etc/ssh/
sshd -t
systemctl daemon-reload
systemctl status sshd
systemctl restart sshd #重启前多ssh连接一个窗口以防不备
sshd -V
+ There are no comments
Add yours