linux教程 ·

CentOS8.2升级openssh至8.4

wget https://cikeblog.com/s/openssh8.4.zip
unzip openssh8.4.zip
备份配置文件
cp /etc/pam.d/{sshd,sshd.bck}
cp /etc/ssh/{sshd_config,sshd_config.bck}
安装
yum install ./*.rpm
恢复备份的配置文件,并重启sshd
mv /etc/ssh/sshd_config.bck /etc/ssh/sshd_config
mv /etc/pam.d/sshd.bck /etc/pam.d/sshd
sed -i '/.*PermitRootLogin.*/d' /etc/ssh/sshd_config
echo -e 'nPermitRootLogin yes' >> /etc/ssh/sshd_config
sed -i '/.*PasswordAuthentication.*/d' /etc/ssh/sshd_config
echo -e 'nPasswordAuthentication yes' >> /etc/ssh/sshd_config
chmod 600 /etc/ssh/*
systemctl restart sshd
ssh -V

参与评论