升级openssl和openssh

鉴于openssl 1.0.1的安全漏洞, 现在都升级1.0.1g版本的openssl了, 这里记录下升级流程.

0. 先查看当前安装的版本

   ssh -V 查看ssh版本

   openssl version -a 查看openssl版本

1. 首先到官网下载新版的源码包

     openssh: http://www.openssh.com/portable.html 这里, 官网上找到的下载有两种, 一种是直接下载OpenBSD的(附带openssh, 显然不是我等需要的), 另外一种就是这种portable版的

     openssl:  http://www.openssl.org/source/

2. 先安装openssl, 一定记得加上--shared选项, 否则openssh编译的时候会找不到新安装的openssl的library, 会报错: openssl的 header和library版本不匹配

    ./config --prefix=/usr --shared
    make
    make test
    make install

    完毕后查看openssl版本安装是否正确

3. 安装openssh

    ./configure --prefix=/usr --with-pam --with-zlib --with-md5-passwords
     make
     make install

     这种安装会把sshd的配置文件放在/usr/etc/sshd_config

     需要重启sshd服务并且重新登录shell, 才能查看openssh是否已经安装新版本, 建议先保留安装openssh的这个shell, 另开一个shell测试, 防止设置错误导致服务器无法连接