Upgrade centos7 openssh & openssl to the latest version
#centos #openssh #openssl #upgrade
If it is manually compiled and installed, the success is not guaranteed. If it comes with, you do not need to uninstall the old version of openssh during the upgrade process.
Try Yum update before installation. If you can update, you don’t need to look down
$ tar xzvf openssh-8.2p1.tar.gz
$ cd openssh-8.2p1/
$ ./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/lib64/ --with-zlib --with-pam --with-md5-password --with-ssl-engine --with-selinux
#Installation
$ make && make install
#Verification
$ ssh -V
OpenSSH_8.2p1, OpenSSL 1.1.1g 21 Apr 2020
$ ls /etc/ssh
moduli ssh_config sshd_config ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_ecdsa_key ssh_host_ecdsa_key.pub ssh_host_ed25519_key ssh_host_ed25519_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub
to configure
1. Modify sshd_ config
$ vim /etc/ssh/sshd_config
#for your custom config for ssh like password login or root login
2. Start up
#Remove the previous SSH service to prevent conflicts with new ones
$ mv /usr/lib/systemd/system/sshd.service /etc/ssh_old/sshd.service
$ mv /usr/lib/systemd/system/sshd.socket /etc/ssh_old/sshd.socket
#Copy some files in the unzip package
$ cp -a contrib/redhat/sshd.init /etc/init.d/sshd
#Restart
$ systemctl restart sshd
$ systemctl daemon-reload
#Add auto start
$ chkconfig --add sshd
$ chkconfig sshd on