当前位置:   article > 正文

openSSH升级9.5p1_openssh9.5

openssh9.5

1.下载openSSh包

        https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.5p1.tar.gz

2.linux命令

tar -zxvf openssh-9.5p1.tar.gz
cd openssh-9.1p1
./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local
make && make install

echo 'PermitRootLogin yes' >>/usr/local/openssh/etc/sshd_config
echo 'PubkeyAuthentication yes' >>/usr/local/openssh/etc/sshd_config
echo 'PasswordAuthentication yes' >>/usr/local/openssh/etc/sshd_config

mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
cp /usr/local/openssh/etc/sshd_config /etc/ssh/sshd_config

mv /usr/sbin/sshd /usr/sbin/sshd.bak
cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd

mv /usr/bin/ssh /usr/bin/ssh.bak
cp /usr/local/openssh/bin/ssh /usr/bin/ssh

mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

mv /etc/ssh/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub.bak
cp /usr/local/openssh/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub

# modify Type=notify to Type=simple
sed -i "s/Type\=notify/Type\=simple/g" /usr/lib/systemd/system/sshd.service

systemctl daemon-reload
systemctl restart sshd

ssh -V

3.总结

        该命令同样适用与 9.1版本升级 亲测可用,我被漏洞检测从7.4版本升到8.4 再升到9.1,现在刚升级到9.5。

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/285817
推荐阅读
相关标签
  

闽ICP备14008679号