zoukankan      html  css  js  c++  java
  • centos7 升级 openssh 到 8.4

    一、下载资源

    wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz  也可以直接下载:wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz

    wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz  也可以直接下载:wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz

    二、安装openssl

    1、卸载 yum remove openssl

    2、解压

    3、在解压目录下执行

    ./config --prefix=/usr/local/ssl -d shared 
    make -j 4 && make install
    echo '/usr/local/ssl/lib' >> /etc/ld.so.conf
    ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
    ln -s /usr/local/ssl/include/openssl /usr/include/openssl
    ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
    ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

    /sbin/ldconfig
    openssl version
    #能够查看到版本号则说明安装成功。

    三、安装openssh
    1、卸载原来的openssh
    yum remove openssh
    2、解压缩
    3、在解压目录下执行
    ./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl --with-zlib=/usr/local/zlib 
    make -j 4 && make install

    echo "X11Forwarding yes" >> /etc/ssh/sshd_config
    echo "X11UseLocalhost no" >> /etc/ssh/sshd_config                
    echo "XAuthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config
    echo "UseDNS no" >> /etc/ssh/sshd_config
    echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
    echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config
    echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config

    mv /usr/sbin/sshd /usr/sbin/sshd.bak
    cp -rf /usr/local/openssh/sbin/sshd /usr/sbin/sshd
    mv /usr/bin/ssh /usr/bin/ssh.bak
    cp -rf /usr/local/openssh/bin/ssh /usr/bin/ssh 
    mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
    cp -rf /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

    #查看版本
    ssh -V
    3、添加服务到systemctl
    cp contrib/redhat/sshd.init /etc/init.d/ chmod +x /etc/init.d/sshd.init
    /etc/init.d/sshd.init start
    cp /run/systemd/generator.late/sshd.init.service /usr/lib/systemd/system/sshd.service

    /etc/init.d/sshd.init stop
    systemctl enable sshd
    systemctl start sshd
  • 相关阅读:
    Sql Server 2008卸载后再次安装一直报错
    listbox 报错 Cannot have multiple items selected when the SelectionMode is Single.
    Sql Server 2008修改Sa密码
    学习正则表达式
    Sql Server 查询第30条数据到第40条记录数
    Sql Server 复制表
    Sql 常见面试题
    Sql Server 简单查询 异步服务器更新语句
    jQuery stop()用法以及案例展示
    CSS3打造不断旋转的CD封面
  • 原文地址:https://www.cnblogs.com/niusj/p/14110045.html
Copyright © 2011-2022 走看看