openssh升级到8.1版本

问题背景

[root@VM-0-4-centos ~]# wget https://cloudflare.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.1p1.tar.gz
[root@VM-0-4-centos ~]# ssh -V
[root@VM-0-4-centos ~]# yum install wget gcc -y
[root@VM-0-4-centos ~]# yum group install ‘Development Tools’ -y
[root@VM-0-4-centos ~]# yum install -y zlib-devel openssl-devel
[root@VM-0-4-centos ~]# yum install pam-devel libselinux-devel zlib-devel openssl-devel -y
[root@VM-0-4-centos ~]# tar -xzf openssh-8.1p1.tar.gz
[root@VM-0-4-centos ~]# cd openssh-8.1p1/
[root@VM-0-4-centos ~]# ./configure --prefix=/usr/ --with-md5-passwords --with-pam --with-zlib --sysconfdir=/etc/ssh
[root@VM-0-4-centos ~]# mkdir /tmp/backup
[root@VM-0-4-centos ~]# mv /etc/ssh/* /tmp/backup
[root@VM-0-4-centos ~]# make && make install
[root@VM-0-4-centos ~]# rm -rf /etc/ssh/*
[root@VM-0-4-centos ~]# cp /tmp/backup/* /etc/ssh/ -r
[root@VM-0-4-centos ~]# chmod -R 600 /etc/ssh/*
[root@VM-0-4-centos ~]# cp -a contrib/redhat/sshd.init /etc/init.d/sshd
[root@VM-0-4-centos ~]# cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
[root@VM-0-4-centos ~]# chmod +x /etc/init.d/sshd
[root@VM-0-4-centos ~]# chkconfig --add sshd
[root@VM-0-4-centos ~]# systemctl enable sshd
[root@VM-0-4-centos ~]# mv /usr/lib/systemd/system/sshd.service /tmp
[root@VM-0-4-centos ~]# chkconfig sshd on
[root@VM-0-4-centos ~]# systemctl restart sshd
[root@VM-0-4-centos ~]# ssh -V

(踩坑)
如重启ssh服务报错,输入sshd -t 检查下配置文件中是否配置错误项。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值