centos7离线升级openssh到8.3版本

1. 下载

下载地址:https://ftp.riken.jp/pub/OpenBSD/OpenSSH/portable/    

以 p1.tar.gz结尾的即可,选择自己想要的版本

2. 解压编译安装

cd /usr/local/src

tar -zxvf openssh-8.3p1.tar.gz

cd openssh-8.3p1

./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/ssl --without-openssl-header-check

make && make install

3. 配置

vim /usr/local/openssh/etc/sshd_config
# 在末尾加入账号远程配置, 输入 :wq 保存退出
PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes

# 以下复制输入 y 确认覆盖即可

cp ./contrib/redhat/sshd.init /etc/init.d/sshd

chkconfig --add sshd

cp /usr/local/openssh/etc/sshd_config /etc/ssh/sshd_config

cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd

cp /usr/local/openssh/bin/ssh /usr/bin/ssh

cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

cp /usr/local/openssh/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub

4. 重启 ssh, 校验版本

service sshd restart

# 注意是大写V
ssh -V

 

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值