I have recently reviewed Linux and installed centos6.5 on the Virtual Machine. By the way, I have upgraded OpenSSH that comes with the system. Any system operation is risky. Please back up the system in the official environment. Paste the Code directly.
1. Prepare and download the corresponding package to the official website. In addition, you need to download the dependent package OpenSSL and zlib.
OpenSSH: http://www.openssh.com/portable.html#http
OpenSSL: http://www.openssl.org/source/
Zlib: http://zlib.net/zlib-1.2.8.tar.gz
2. Uninstall the built-in OpenSSH. Stop the sshd service before uninstalling it, delete it with rpm, and clear the/etc/ssh directory of the system.
[[email protected] tmp]# service sshd stopStopping sshd: [ OK ] [[email protected] tmp]# rpm -qa opensshopenssh-5.3p1-94.el6.x86_64[[email protected] tmp]# rpm -e openssh-server[[email protected] tmp]# rpm -e openssh-clients[[email protected] tmp]# rpm -e openssh-askpass[[email protected] tmp]# rpm -e openssh[[email protected] tmp]# rm -rf /etc/ssh
3. Install zlib
[[email protected] tmp]# tar -xvf zlib-1.2.8.tar.gz [[email protected] tmp]# cd zlib-1.2.8[[email protected] zlib-1.2.8]# ./configure --prefix=/usr/local/zlib && make && make install
4. Install OpenSSL
[[email protected] tmp]# tar -xvf openssl-1.0.1i.tar.gz [[email protected] tmp]# cd openssl-1.0.1i[[email protected] openssl-1.0.1i]# ./config --prefix=/usr/local/openssl && make && make install
5. install OpenSSH
[[email protected] tmp]# tar -xvf openssh-6.6p1.tar.gz[[email protected] tmp]# cd openssh-6.6p1[[email protected] openssh-6.6p1]# ./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/zlib --with-md5-passwords --without-hardening && make && make install
6. modify the configuration file
[[email protected] openssh-6.6p1]# cp contrib/redhat/sshd.init /etc/init.d/sshd[[email protected] openssh-6.6p1]# chmod +x /etc/init.d/sshd [[email protected] openssh-6.6p1]# vi /etc/init.d/sshd
Modify the installation directory of the corresponding command ============================ 25 lines sshd =/ usr/sbin/sshd is sshd =/usr/local/OpenSSH/sbin/sshd41 line/usr/bin/ssh-keygen-A is/usr/local/OpenSSH/bin/ssh -keygen-A ============================ save and exit
7. Add to System Service
[[email protected] openssh-6.6p1]# chkconfig --add sshd[[email protected] openssh-6.6p1]# service sshd start
8. For errors encountered during compilation, refer to the blog article http://z?sk.blog.163.com/blog/static/598306132014313425351/. Thank You For Your sharing.
configure: error: *** Can‘t find recent OpenSSL libcrypto (see config.log for details) ***
Upgrade OpenSSH to centos 6.5