openssh【5.3】升级到openssh【7.7】

公司线上环境安全监测,openssh升级OpenSSH 到最新版本OpenSSH_7.7p1 (2018-04)来减少漏铜。升级过程如下:


1、基本环境准备
  系统环境:CentOS release 6.8 (Final)
2、安装过程
  1)下载openssh-7.7p1.tar.gz,上传到服务器解压。
    下载地址:https://download.csdn.net/download/qq_41018670/10404979
  2)备份ssh原有的配置文件
    #tar zcvf /etc/ssh.tar.gz  /etc/ssh
  3)卸载原来的sshd服务
    #yum remove openssh
  4)安装openssh编译所需要的依赖包
    #yum  install -y gcc libstdc++-devel gcc-c++ zlib-devel keyutils-libs-devel libcom_err-devel libsepol-devel pkgconfig libsepol libselinux-devel krb5-devel openssl-devel
  5)编译
    #cd openssh-7.7p1
    #./configure 
    #make
    #make install
  【*】默认路径
  User binaries: /usr/local/bin
  System binaries: /usr/local/sbin
  Configuration files: /usr/local/etc
  Askpass program: /usr/local/libexec/ssh-askpass
  Manual pages: /usr/local/share/man/manX
  PID file: /var/run
  Privilege separation chroot path: /var/empty
  sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  6)启动方式
  将安装源程序目录下的/openssh-7.7p1/contrib/redhat/sshd.init  复制到 /etc/init.d/sshd
  修改启动文件:
  vim /etc/init.d/sshd   #修改sshd文件
  SSHD=/usr/local/sbin/sshd
  /usr/local/bin/ssh-keygen -A 
  /sbin/restorecon /usr/local/etc/ssh_host_rsa_key.pub
  /sbin/restorecon /usr/local/etc/ssh_host_dsa_key.pub
  /sbin/restorecon /usr/local/etc/ssh_host_ecdsa_key.pub
  7)修改配置文件
  vim /usr/local/etc/sshd_config     #配置sshd_config文件
  PermitRootLogin yes                #允许root登录
  8)启动sshd服务
  service sshd start
  9)验证
  ssh -V

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值