鑑於openssl 1.0.1的安全漏洞, 如今都升級1.0.1g版本的openssl了, 這裏記錄下升級流程.html
0. 先查看當前安裝的版本shell
ssh -V 查看ssh版本安全
openssl version -a 查看openssl版本服務器
1. 首先到官網下載新版的源碼包ssh
openssh: http://www.openssh.com/portable.html 這裏, 官網上找到的下載有兩種, 一種是直接下載OpenBSD的(附帶openssh, 顯然不是我等須要的), 另一種就是這種portable版的測試
openssl: http://www.openssl.org/source/htm
2. 先安裝openssl, 必定記得加上--shared選項, 不然openssh編譯的時候會找不到新安裝的openssl的library, 會報錯: openssl的 header和library版本不匹配md5
./config --prefix=/usr --shared
make
make test
make installssl
完畢後查看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測試, 防止設置錯誤致使服務器沒法鏈接