zoukankan      html  css  js  c++  java
  • RedHat 7.0更新升级openSSH7.4p1

    由于目前服务器上ssh版本较低,存在安全漏洞,需要升级到最新版本。

    系统版本:RedHat 7.0

    openSSH版本:6.4p1

    openSSH版本:7.4p1

    升级方式:源码安装

    安装操作步骤如下:

    1、更新ssl

    #yum update openssl  

    2、备份ssh目录

    #cp -rf /etc/ssh /etc/ssh.bak  

    注:安装telnet,以备ssh更新失败无法远程连接,如果可以现场操作可忽略

    3、安装升级所需组件

    #yum install -y gcc openssl-devel pam-devel rpm-build  

    4、解压升级包,并安装

    tar -zxvf openssh-7.4p1.tar.gz   
    cd openssh-7.4p1  
    ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords   
    make && make install  

    或者yum源安装

    #yum -y install openssh openssh-clients openssh-server

    需要安装客户端和服务端、启动服务端和设置下开机启动。

    5、修改配置文件

    vim /etc/ssh/sshd_config  

    1)、修改PermitRootLogin

    #PermitRootLogin yes
    修改为
    PermitRootLogin yes

    2)、注释掉下面的新版本不支持的配置

    #GSSAPIAuthentication yes

    #GSSAPICleanupCredentials yes

    编辑脚本ssh_chmod.sh并执行(这是执行查看状态发现权限不对进行相应的修改,可根据情况自行设置)

    #!/bin/bash
    cd /etc/ssh
    chmod 600 ssh_host_rsa_key
    chmod 640 ssh_host_ed25519_key
    chown -R root:ssh_keys ssh_host_ed25519_key
    chmod 600 ssh_host_ecdsa_key
    

     

    6、重启SSH

    #systemctl restart sshd

    7、查看SSH状态

    #systemctl status sshd

    如需提前卸载旧版,可按照下述步骤操作

    1、查看旧版openSSH

    #rpm -qa | grep openssh 

    2、卸载旧版openSSH

    #rpm -e `rpm -qa | grep openssh` --nodeps  

    注:

    1、在configure openssh时,如果有参数 –with-pam,会提示:“PAM is enabled. You may need to install a PAM control file for sshd, otherwise password authentication may fail. Example PAM control files can be found in the contrib/ subdirectory”提示文字,

    就是如果启用PAM,需要有一个控制文件,按照提示的路径找到redhat/sshd.pam,并复制到/etc/pam.d/sshd,在/etc/ssh/sshd_config中打开UsePAM yes。发现连接服务器被拒绝,关掉就可以登录

    https://blog.csdn.net/mayifan0/article/details/73293419

  • 相关阅读:
    考研竞赛数学微信交流群
    华东师范大学数学分析第5版提要03.04.01证明
    大学生数学竞赛题目分类30章之第02章函数极限202104版已发54题
    研赛02994北京大学数学分析习题集2.3.1(3)参考解答
    复旦大学高等代数问题2016A12参考解答
    华东师范大学数学分析第5版03.03函数极限存在的条件
    大学生数学竞赛题目分类30章之第01章数列极限202104版已发33题
    研赛02992北京大学数学分析习题集23.1
    裴礼文数学分析中的典型问题与方法第3版勘误32个
    Evans277-281
  • 原文地址:https://www.cnblogs.com/jzhg/p/8984412.html
Copyright © 2011-2022 走看看