openssh升级8.9

openssl

$ wget -c https://www.openssl.org/source/openssl-3.0.2.tar.gz --no-check-certificate
$ mv /usr/bin/openssl /usr/bin/openssl.old
$ mv /usr/include/openssl /usr/include/openssl.old
$ tar xf openssl-3.0.2.tar.gz 
$ cd openssl-3.0.2/
$ yum install -y perl-CPAN zlib-devel pam-devel
$ perl -MCPAN -e shell
cpan[1]> install IPC/Cmd.pm
$ ./config  --prefix=/usr/local/openssl
$ make && make install
$ ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
$ ln -s /usr/local/openssl/include/openssl /usr/include/openssl
#配置动态链接搜索库
$ echo "/usr/local/openssl/lib64" >> /etc/ld.so.conf
#使修改后的/etc/ld.so.conf生效 
$ ldconfig
#验证版本
$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

openssh

$ curl -O https://mirrors.aliyun.com/openssh/portable/openssh-8.9p1.tar.gz
$ ./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl --with-md5-passwords --mandir=/usr/share/man --with-zlib
$ make && make install
$ vim /usr/local/openssh/etc/sshd_config
PermitRootLogin yes
UseDNS no

$ cp /usr/local/src/openssh-8.9p1/contrib/redhat/sshd.init  /etc/init.d/sshd
$ cp /usr/local/src/openssh-8.9p1/contrib/redhat/sshd.pam  /etc/pam.d/sshd.pam
#移除旧的服务文件
$ mv /usr/lib/systemd/system/sshd.service /tmp
$ systemctl daemon-reload
$ chkconfig  --add sshd
$ ssh -V
OpenSSH_8.9p1, OpenSSL 3.0.2 15 Mar 2022
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值