手动编译安装OpenSSL与OpenSSH
1、安装必要工具
yum install -y tar zlib-devel
2、编译安装 OpenSSL
cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
tar -xvzf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl LDFLAGS="-Wl,-rpath=/usr/local/openssl/lib"
make && make install
/usr/local/openssl/bin/openssl version
ldd /usr/local/openssl/bin/openssl
3、编译安装 OpenSSH
cd /usr/local/src
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz
tar -xvzf openssh-9.8p1.tar.gz
cd openssh-9.8p1
./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/openssl --sysconfdir=/usr/local/openssh/etc LDFLAGS="-Wl,-rpath=/usr/local/openssl/lib"
make && make install
/usr/local/openssh/sbin/sshd -V
ldd /usr/local/openssh/sbin/sshd
5、备份旧的配置文件
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
cp /etc/ssh/ssh_config /etc/ssh/ssh_config.bak
# 请根据实际情况修改ssh/sshd配置文件及systemd文件,以及处理系统自带的sshd服务
作者:wanghongwei
版权声明:本作品遵循<CC BY-NC-ND 4.0>版权协议,商业转载请联系作者获得授权,非商业转载请附上原文出处链接及本声明。