OpenSSH升级最新版
1. 下载包
升级最新的OpenSSH需要升级OpenSSL最新
OpenSSH最新版下载地址: Index of /pub/OpenBSD/OpenSSH/portable/
OpenSSL最新版下载地址: /source/index.html (openssl.org)
2. 升级OpenSSL
本次下载的版本为openssl-3.0.12.tar.gz
#进入目录 cd /opt/ #下载 wget https://www.openssl.org/source/openssl-3.0.12.tar.gz --no-check-certificate #解压 tar zxvf openssl-3.0.12.tar.gz #进入解压后的文件夹 cd openssl-3.0.12 #执行Configure ./Configure #编译并安装 make && make install #重新加载配置 ldconfig #查看版本 openssl version
3. 升级openSSH
#进入目录 cd /opt #下载最新版本 wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.5p1.tar.gz #解压 tar zxvf openssh-9.5p1.tar.gz #执行configure ./configure #安装 make && make install #重启sshd服务 systemctl restart sshd #查看版本,如果版本为改变需要重启电脑 ssh -V
可能遇见的错误
1. make && make install 执行报错
#需要安装c语言编译环境 yum install -y gcc
2. ssh安装过程中提示找不到OpenSSL:configure: error: OpenSSL library not found.
#需要在 ./configure增加参数 ./configure --with-ssl-dir=#OpenSSL路径
#需要在 ./configure增加参数
./configure --with-ssl-dir=#OpenSSL路径