Centos7.0 SSH升級

安裝gcc

yum install gcc -y

安裝perl-devel

yum install perl-devel

安裝openssl-devel

yum install -y openssl-devel

編譯

tar -zxvf openssh-8.3p1.tar.gz
cd openssh-8.3p1
./configure --prefix=/usr/local/openssh --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/zlib --with-md5-passwords && make && make install

注:此處若是重新安裝了最新的openssl,則填寫安裝地址,如下圖
在這裏插入圖片描述
在這裏插入圖片描述

備份啓動腳本/etc/init.d

cp -p /etc/init.d/sshd /etc/init.d/sshd.lod_$(date +%Y-%m-%d_%H-%M)

刪除舊的並複製新的

rm /etc/init.d/sshd
cp -p contrib/redhat/sshd.init /etc/init.d/sshd

賦予執行權限

chmod u+x /etc/init.d/sshd

加入開機啓動

chkconfig --add sshd
chkconfig sshd on

在這裏插入圖片描述

修改或查看配置

vi /etc/ssh/sshd_config
PermitRootLogin yes
X11Forwarding yes
PubkeyAuthentication yes

授權並重啓:


chmod 600 /etc/ssh/ssh_host_rsa_key
chmod 600 /etc/ssh/ssh_host_ecdsa_key
/etc/init.d/sshd restart / service sshd restart

在這裏插入圖片描述

檢查版本:

ssh -V

在這裏插入圖片描述

問題

  1. 提示下面關於openssl的錯(若是ssh版本與ssl不匹配,則先升級openssl版本)
configure: error: *** OpenSSL headers missing - please install first or check config.log ***

解決辦法:查看此處路徑是否爲自己安裝openssl的路徑
在這裏插入圖片描述

參考:

RedHat5 升級OpenSSH服務

Linux升級OpenSSH 和 OpenSSL 詳細步驟

Centos7 升級 SSH步驟及注意事項

Centos7 升級 SSH步驟及注意事項

centos7 telnet服務的安裝和啓動

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章