centos7离线升级openssh到8.3版本

    技术2025-10-09  5

    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

     

    Processed: 0.009, SQL: 9