1. 下载源码包 # openssh 下载地址 http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.4p1.tar.gz # openssl 下载地址 https://www.openssl.org/source/old/0.9.x/openssl-0.9.8t.tar.gz 2. 编译安装openssl # 需要修改Makefile 在 CFLAG 项中加入-fPIC
# 否则后续 OpenSSH 编译会报错 Can‘t find recent OpenSSL libcrypto
tar -zxvf openssl-0.9.8t.tar.gz cd openssl-0.9.8t ./config make make install mv /usr/bin/openssl /usr/bin/openssl.bak ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl 3. 编译安装openssh
tar -zxvf openssh-7.4p1.tar.gz cd openssh-7.4p1 ./configure --with-ssl-dir=/usr/local/ssl make make install 4. 配置相关文件 mv /etc/ssh/ssh_config /etc/ssh/ssh_config.bak cp openssh-7.4p1/ssh_config /etc/ssh/ssh_config
5. 设置开机启动 chmod u+x /etc/init.d/sshd chkconfig --add sshd chkconfig sshd on
6. 启动服务 service sshd restart
7. 查看版本
openssl version
ssh -V
telnet 127.0.0.1 22
标签:sshd,tar,openssh,openssl,Centos5,源码,ssh,usr From: https://www.cnblogs.com/yuejunasia/p/18056607