首页 > 其他 > 详细

centos7 升级openssh

时间:2020-09-21 23:46:34      阅读:89      评论:0      收藏:0      [点我收藏+]
#!/bin/sh
cp /etc/pam.d/sshd /tmp
cd /tmp
yum install  -y gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam* zlib*
wget http://mirrors.shanghai-electric.com:8081/nexus/repository/Third-party/openssh-8.1p1.tar.gz
for i in $(rpm -qa |grep openssh);do rpm -e $i --nodeps;done
tar -zxvf openssh-8.1p1.tar.gz
cd openssh-8.1p1
./configure --prefix=/usr --sysconfdir=/etc/ssh
rm -rf /etc/ssh
make && make install
cp -rp contrib/redhat/sshd.init /etc/init.d/sshd
cp -rp contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
chmod +x /etc/init.d/sshd
mv  /usr/lib/systemd/system/sshd.service  /tmp
chkconfig --add sshd
chkconfig --list|grep sshd
systemctl enable sshd
chkconfig sshd on
echo "PermitRootLogin yes" >>/etc/ssh/sshd_config
echo "ClientAliveInterval 600">>/etc/ssh/sshd_config
echo "ClientAliveCountMax 0">>/etc/ssh/sshd_config
echo "MaxAuthTries 3">>/etc/ssh/sshd_config
cp /tmp/sshd /etc/pam.d/
setenforce 0
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config
systemctl restart sshd
ssh -V

  

centos7 升级openssh

原文:https://www.cnblogs.com/y593216/p/13709350.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!