Centos 7.4系統升級OpenSSH 8.4p1服務
OpenSSH是Linux系統遠端登陸服務,預設埠是22,在升級服務時請先做好故障預估,在本伺服器安裝Telnet服務,並連線到伺服器再升級,避免升級過程中出現故障導致伺服器不能連線。
1.檢視ssh服務當前版本,安裝Telnet服務(避免SSH服務遠端登陸不上)
[root@nginx02 ~]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
[root@nginx02 data]# yum install xinetd telnet-server -y
[root@nginx02 data]# vim /etc/xinetd.d/telnet
{
disable = yes
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
[root@nginx02 data]# vim /etc/securetty
pts/0
pts/1
pts/2
pts/3
[root@nginx02 data]# systemctl enable xinetd
[root@nginx02 data]# systemctl enable telnet.socket
Created symlink from /etc/systemd/system/sockets.target.wants/telnet.socket to /usr/lib/systemd/system/telnet.sock
[root@nginx02 data]# systemctl start telnet.socket
[root@nginx02 data]# systemctl start xinetd
[root@nginx02 data]# netstat -lntp|grep 23
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 1/systemd
[root@nginx02 data]#
2.使用Xshell登陸伺服器(23埠)
3.下載及安裝OpenSSH 8.4服務
[root@nginx02 ~]# wget
[root@nginx02 ~]# tar xvf openssh-8.4p1.tar.gz
[root@nginx02 ~]# cd openssh-8.4p1
[root@nginx02 openssh-8.4p1]# ./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl --with-zlib=/usr/local/zlib
[root@nginx02 openssh-8.4p1]# chmod 600 /etc/ssh/ssh_host_*
[root@nginx02 openssh-8.4p1]# make -j 4 && make install
[root@nginx02 openssh-8.4p1]# mv /usr/sbin/sshd /usr/sbin/sshd.bak
[root@nginx02 openssh-8.4p1]# cp -rf /usr/local/openssh/sbin/sshd /usr/sbin/sshd
[root@nginx02 openssh-8.4p1]# mv /usr/bin/ssh /usr/bin/ssh.bak
[root@nginx02 openssh-8.4p1]# cp -rf /usr/local/openssh/bin/ssh /usr/bin/ssh
[root@nginx02 openssh-8.4p1]# mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
[root@nginx02 openssh-8.4p1]# cp -rf /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen
[root@nginx02 openssh-8.4p1]#
4.刪除ssh老服務,使用新服務啟動
[root@nginx02 openssh-8.4p1]# systemctl stop sshd.service
[root@nginx02 openssh-8.4p1]# rm -rf /lib/systemd/system/sshd.service
[root@nginx02 openssh-8.4p1]# systemctl daemon-reload
[root@nginx02 openssh-8.4p1]# cp -a contrib/redhat/sshd.init /etc/init.d/sshd
[root@nginx02 openssh-8.4p1]# /etc/init.d/sshd restart
Reloading systemd: [ OK ]
Restarting sshd (via systemctl): [ OK ]
[root@nginx02 openssh-8.4p1]# ssh -V
OpenSSH_8.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 --升級成功
[root@nginx02 openssh-8.4p1]#
5.如果xshell登陸出現警告(是因為新的openssh服務與xshell不相容問題)
解決方法:
[root@nginx02 openssh-8.4p1]# vim /etc/ssh/sshd_config
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1
[root@nginx02 openssh-8.4p1]# /etc/init.d/sshd restart
Restarting sshd (via systemctl): [ OK ]
[root@nginx02 openssh-8.4p1]#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25854343/viewspace-2756138/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- openssh升級7.4p1至8.4p1、openssl升級至openssl-1.1.1h
- Openssh 8.4p1及Openssl 1.1.1h升級
- OpenSSH升級(從OpenSSH_7.4p1升級到OpenSSH_8.4p1) [操作指令碼]指令碼
- Centos升級到openssh9.7CentOS
- redhat系統升級openssh到7.5Redhat
- Centos6.5 離線 Openssh 升級CentOS
- Centos7 升級openssh到最高版本CentOS
- Ctyun系統升級OpenSSH 9.3詳細教程
- redhat 7.4從openssh7.6離線升級openssh8.4p1解決方法Redhat
- Centos7.4 python3 升級pipCentOSPython
- openssh 漏洞修復 openssl升級 OpenSSH_9.8p1麒麟系統
- Openssh-7.9p1升級+系統調優
- CentOS6.9下升級預設的OpenSSH操作記錄(升級到OpenSSH_7.6p1)CentOS
- centos7.4 開啟ftp服務CentOSFTP
- Centos7 openssh升級到7.9p1CentOS
- centos6.5中openssh從5.3升級到7.3CentOS
- RHEL6_CentOS6_Openssh8.0p1升級CentOS
- Centos7 升級至openssh-9.8p1CentOS
- Ubuntu升級opensshUbuntu
- aix升級opensshAI
- 升級openssh7.9
- Linux openssh升級8.0Linux
- 原始碼升級SUSE openssh原始碼
- RHEL7X_CentOS7X_升級Openssh7.6p1CentOS
- Centos 7.4_64位系統安裝指南CentOS
- Centos7系統配置DNS服務CentOSDNS
- Mac 升級 PHP 到 7.4 版本MacPHP
- 適用於openEuler系統升級openssh9.8p1和openssl3.3.1
- suse11 openssh 升級到8.0
- [openssh]windows 10使用cygwin安裝openssh服務端Windows服務端
- centos7 離線升級/線上升級作業系統核心CentOS作業系統
- readhalt7.4 系統替換 CentOS7 yum 源CentOS
- 數字門店服務系統,助力線下門店轉型升級
- Ubuntu16.04升級openssh-9.8p1Ubuntu
- 升級 Docker 中的 gitlab 服務DockerGitlab
- CentOS 7 升級到 CentOS 8CentOS
- ssh7.4升級到9.3p2
- 升級 PHP 7.4 帶來的兩個大坑PHP