centos7升级从openssh7.4升到openssh-8.2版本

centos7升级openssh
1.关闭防火墙
2.关闭selinux
//关闭防火墙
systemctl disable firewalld.service
systemctl stop firewalld.service
//关闭selinux
getenforce
setenforce 0
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/’ /etc/selinux/config
ll
//安装telnet
yum install -y telnet-server
yum install -y xinetd
systemctl start telnet.socket
systemctl start xinetd
echo ‘pts/0’ >>/etc/securetty
echo ‘pts/1’ >>/etc/securetty
systemctl restart telnet.socket
//创建普通用户
useradd test
passwd test
//验证telent连接服务器
telnet IP
输入普通用户名和密码,然后在su root
//升级openssh
yum install zlib-devel openssl-devel pam-devel -y
cp -r /etc/ssh /etc/ssh.old
rpm -qa|grep openssh
rpm -e --nodeps openssh-7.4p1-11.el7.x86_64
rpm -e --nodeps openssh-server-7.4p1-11.el7.x86_64
rpm -e --nodeps openssh-clients-7.4p1-11.el7.x86_64
rpm -qa|grep openssh
wget https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.2p1.tar.gz
tar xf openssh-8.2p1.tar.gz
cd openssh-8.2p1
ll
yum -y install gcc
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam
echo $?
make
echo $?
chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
chmod 600 /etc/ssh/ssh_host_ed25519_key
make install
echo $?
install -v -m755 contrib/ssh-copy-id /usr/bin
echo PermitRootLogin yes >> /etc/ssh/sshd_config
cp -p contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
chkconfig --list sshd
systemctl restart sshd
ssh -V
在这里插入图片描述
systemctl status sshd

验证重启服务器是否可以正常登录,如果没问题关闭telnet
systemctl stop telnet.socket
systemctl disable telnet.socket
systemctl stop xinetd.service
systemctl disable xinetd.service

错误:
configure: error: OpenSSL library not found.
[root@node2 openssh-8.2p1]# /usr/local/bin/openssl version
OpenSSL 1.1.1c 28 May 2019
[root@node2 openssh-8.2p1]# /bin/openssl version
解决方法:
rpm -qa|grep openssl
rpm -e openssl-devel-1.0.2k-19.el7.x86_64 --nodeps
rpm -e openssl-1.0.2k-19.el7.x86_64 --nodeps
rpm -e openssl-libs-1.0.2k-19.el7.x86_64 --nodeps

你可能感兴趣的:(linux运维)