OpenSSH升级

脚本

#!/bin/bash
###############################
#Author: sss
#Date: 2021-09-04
#Description: update OpenSSH8.6
###############################
wget https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.6p1.tar.gz
yum remove -y openssh
yum install -y pam* zlib* perl* openssl-devel
tar -zxvf openssh-8.6p1.tar.gz
cd openssh-8.6p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr --with-zlib=/usr/local/lib64 --without-hardening
make
chmod 600 /etc/ssh/ssh_host*
make install echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "UseDNS no" >> /etc/ssh/sshd_config
cp -a contrib/redhat/sshd.init /etc/init.d/sshd
cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
chmod +x /etc/init.d/sshd
chkconfig --add sshd
systemctl enable sshd
chkconfig sshd on
/etc/init.d/sshd restart
setenforce 0
sed -i s#SELINUX=enforcing#SELINUX=disabled# /etc/selinux/config

OpenSSH升级

上一篇:linux下编译cpp文件


下一篇:linux shell命令之tee调试