CentOS7 OpenSSH 升级

下载openssh-7.9p1.tar.gz

http://www.openssh.com/portable.html

将 openssh-7.9p1.tar.gz 与 openssh_update.sh 复制到相应目录

yum install -y gcc openssl-devel pam-devel rpm-build
sh openssh_update.sh

openssh_update.sh

# 关闭Selinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux
# 卸载 openssh
rpm -qa |grep  openssh
for i in $(rpm -qa |grep openssh);do rpm -e $i --nodeps;done
# 安装 openssh
tar -xvf openssh-7.9p1.tar.gz
cd openssh-7.9p1
 ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords--with-pam --with-tcp-wrappers  --with-ssl-dir=/usr/local/ssl --without-hardening
rm -rf /etc/ssh
make && make install
cp contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
chkconfig --list|grep sshd
sed -i "32a PermitRootLogin yes" /etc/ssh/sshd_config
systemctl restart sshd.service
systemctl status sshd.service

你可能感兴趣的:(CentOS7 OpenSSH 升级)