linux上將OpenSSH7.4升級到8.0

紅色的字表示要執行的命令

1:查看當前的openssh版本

ssh -V

2:安裝必要的組件

yum install -y gcc openssl-devel pam-devel rpm-build

3:cd到放安裝包的地方,可隨意,以下soft是隨意寫的,可替換

cd /soft

4: 下載8.0的安裝包以及解壓

wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz

tar -zxvf openssh-8.0p1.tar.gz

5:進入openssh-8.0p1目錄

 cd openssh-8.0p1/

6:確認電腦上usr和/etc/ssh目錄地址,替換以下綠色的信息

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers
如果有報錯解決報錯 

7:執行
make && make install

8:如果出現如下問題

Permissions 0640 for '/etc/ssh/ssh_host_ecdsa_key' are too open

解決:
修改相關提示文件的權限爲600,並重啓sshd服務(systemctl restart sshd.service)
查看服務狀態(systemctl status sshd.service)
例:chmod 600 /etc/ssh/ssh_host_ecdsa_key

9:查看現在的版本,應該是8.0了

ssh -V

10:查看 “sshd_config”文件在哪裏,並且去修改,允許遠程可以root登錄

       以下行前面註釋即可

         #PermitRootLogin yes

11:重啓服務
       service sshd restart

或者

systemctl restart sshd.service

 

 

 

systemctl restart sshd

問題:
     /etc/ssh/sshd_config line 81: Unsupported option GSSAPIAuthentication
     /etc/ssh/sshd_config line 83: Unsupported option GSSAPICleanupCredentials

解決:
  則註釋相關行即可

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