安装telnet-server,增加逃生模式

yum install -y telnet telnet-server
mv /etc/securetty /etc/securetty.bak
systemctl enable telnet.socket
systemctl start telnet.socket

卸载软件

yum remove -y openssl openssl-devel openssh

安装编译软件

yum install -y gcc -y

安装依赖openssl

cd /root
wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1v.tar.gz -O openssl-1.1.1v.tar.gz --no-check-certificate
tar xzvf openssl-1.1.1v.tar.gz
cd openssl-1.1.1v
#./config --prefix=/usr/local/src/openssl-1.1.1v
./config --prefix=/usr
make
make install

编译OpenSSH9.5

yum install -y perl-WWW-Curl gcc krb5-devel zlib-devel pam-devel 

cd /root
wget "https://mirrors.aliyun.com/openssh/portable/openssh-9.5p1.tar.gz?spm=a2c6h.25603864.0.0.73a73bf91qaLdj" -O openssh-9.5p1.tar.gz
tar xzvf openssh-9.5p1.tar.gz
cd /root/openssh-9.5p1

echo '/usr/local/src/openssl-1.1.1v/lib' > /etc/ld.so.conf.d/openssl.conf ; ldconfig -v;
#./configure --prefix=/usr/local/src/openssh9 --with-ssl-dir=/usr/local/src/openssl-1.1.1v/ --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-tcp-wrappers
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-tcp-wrappers
make
mv /etc/ssh /etc/ssh.bak
#chmod 600 /etc/ssh/*
make install
cd /usr/local/src/openssh9/ && rsync -avzP * /usr/

echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
cp -a contrib/redhat/sshd.init /etc/init.d/sshd



sshd -V
最后修改:2024 年 05 月 11 日
如果觉得我的文章对你有用,请随意赞赏