• CentOS 升级 OpenSSH


    OpenSSH 安装包

    http://www.openssh.com/portable.html
    https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/

    查看版本

    系统版本

    # 记录下面信息,在更新后进行检查
    # 主机名
    hostname -I
    # 系统版本
    cat /etc/redhat-release
    # SSH版本
    ssh -V
    # openssl 安装目录
    openssl version -a
    # 检查依赖包是否已安装 
    rpm -qa | grep -E  "zlib-devel|openssl-devel|gcc"
    

    备份OpenSSH

    备份需要升级的配置文件

    mkdir /etc/ssh.bak
    mv /etc/ssh/ /etc/ssh.bak/
    

    升级

    上传最新版安装包

    tar xf openssh-8.5p1.tar.gz  
    cd openssh-8.5p1
    ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-md5-passwords 
    
    make && make install
    

    --prefix 安装目录
    --sysconfdir 配置文件目录
    --with-ssl-dir 指定 OpenSSL 的安装目录
    --with-privsep-path 非特权用户的chroot目录
    --with-privsep-user=sshd 指定非特权用户为sshd
    --with-zlib 指定zlib库的安装目录
    --with-md5-passwords 支持读取经过MD5加密的口令
    --with-ssl-engine 启用OpenSSL的ENGINE支持

    重启SSH

    升级后已经要进行重启sshd,不重启的话,你会发现登录显示密码错误

    systemctl restart sshd
    

    遇到的错误

    configure: error: *** zlib.h missing – please install first or check config.log

     yum install -y zlib-devel
    

    configure: error: *** working libcrypto not found, check config.log

    yum install -y openssl-devel
    

    configure: error: no acceptable C compiler found in $PATH

    yum install -y gcc
    

    configure: error: *** OpenSSL headers missing – please install first or check config.log

    yum install -y openssl-devel
    
  • 相关阅读:
    【SpringBoot系列】邮件发送
    【问题】InteliJ IDEA生成可执行jar运行提示没有主清单属性
    【设计模式】单例设计模式
    【C3P0】C3P0
    【JDBC】JDBC学习(一)
    react hook 防抖
    主线程 宏任务 微任务
    vue 2.0 渲染dom过程
    源码阅读笔记,杂乱
    vue 3.0 响应式原理
  • 原文地址:https://www.cnblogs.com/syavingcs/p/14551771.html
Copyright © 2020-2023  润新知