Centos6.5 openssh 5.4離線 升級為 openssh 7.7,使用rpm包安裝
很多l(xiāng)inux 沒有g(shù)cc c++ 等編譯環(huán)境,并且處于內(nèi)網(wǎng)環(huán)境,無法通過yum 命令直接安裝軟件,又由于編譯軟件所需要的依賴較多,安裝起來相當(dāng)麻煩。所以使用一臺可以聯(lián)網(wǎng)的Linux 將源碼打成rpm包,在去內(nèi)網(wǎng)linux 安裝,即可省去內(nèi)網(wǎng)linux 安裝編譯環(huán)境所帶來的的困擾
版本
Linux Centos6.5
OpenSSH 5.3 升級到OpenSSH 7.7
將openssh 7.7 源碼打包成rpm
具體打包步驟
https://blog.csdn.net/crime_lamb/article/details/131282433
或直接下載打好的包
https://download.csdn.net/download/crime_lamb/87928374
注意事項
由于升級的是SSH 如果操作不好就再也無法通過客戶端遠程上服務(wù)器了,
操作前一定多創(chuàng)建幾個連接,并在修改后確認可以再次連接上后,再關(guān)閉其他遠程連接
包目錄
- openssh7.7rpm.zip
- openssh-7.7p1-1.el6.x86_64.rpm
- openssh-clients-7.7p1-1.el6.x86_64.rpm
- openssh-server-7.7p1-1.el6.x86_64.rpm
安裝
安裝
- 1.更新
# 由于依賴問題需要先卸載 openssh5.3 中的openssh-askpass-5.3p1-94.el6.x86_64 rpm -e --nodeps openssh-askpass # 使用rpm 更新包 rpm -Uvh openssh*
2.修改配置
# 修改sshd 配置文件,找到相應(yīng)配置,并改成一下配置 # /etc/ssh/sshd_config PermitRootLogin yes PasswordAuthentication yes UsePAM yes
3.修改系統(tǒng)文件
vim /etc/pam.d/ssh # 直接覆蓋原ssh的文件內(nèi)容 #%PAM-1.0 auth required pam_sepermit.so auth include password-auth account required pam_nologin.so account include password-auth password include password-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open env_params session optional pam_keyinit.so force revoke session include password-auth
4.重啟sshd
# 重啟sshd service sshd restart
安裝命令擴展
安裝
# 安裝 rpm -ivh xxxx
更新
# rpm 模擬安裝rpm包,可以提前檢查出缺失的依賴(* 是匹配所有,也可以一個一個測試安裝) rpm -Uvh --test openssh* # 更新(解決完依賴后,安裝) rpm -Uvh openssh*
卸載
# 卸載包,但不卸載依賴 rpm -e --nodeps xxx
擴展
錯誤排查
-
SSH連接日志查看(客戶端連接不上服務(wù)器)文章來源:http://www.zghlxwxcb.cn/news/detail-500222.html
# 如客戶端鏈接不上,可根據(jù)里面提示再具體百度 tail -f /var/log/messages
參考內(nèi)容
使用編譯方式安裝
https://www.jianshu.com/p/de60b02b9ead文章來源地址http://www.zghlxwxcb.cn/news/detail-500222.html
到了這里,關(guān)于Centos6.5 openssh 5.4離線 升級為 openssh 7.7,使用rpm包安裝的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!