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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值