参考https://www.cnblogs.com/y593216/p/13647033.html
一、安装telnet
apt install telnetd
二、安装依赖包
apt install libzip-dev libssl-dev autoconf gcc libxml2 make -y
三、下载安装包并上传
openssh-8.4
https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz
openssl
https://www.openssl.org/source/old/1.1.1/openssl-1.1.1h.tar.gz
zlib
http://www.zlib.net/zlib-1.2.11.tar.gz
四、使用telnet登录,进行安装
1、解压
tar -zxf openssh-8.4p1.tar.gz
tar -zxf openssl-1.1.1h.tar.gz
tar -zxf zlib-1.2.11.tar.gz
2、安装zlib
cd /usr/local/zlib-1.2.11
./configure --prefix=/usr/local/zlib
make && make install
更新动态链接数据库
echo "/usr/local/zlib/lib" >> /etc/ld.so.conf
ldconfig -v
3、安装openssl
cd /usr/local/openssl-1.1.1h
./config shared --prefix=/usr/local/ssl
#测试安装(要很长时间)
make test
#显示Result: PASS(测试通过),进行安装(要很长时间)
make install
#软链接安装目录
ln -s /usr/local/ssl/lib/libssl.so.1.1 /usr/lib/libssl.so.1.1
ln -s /usr/local/ssl/lib/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.1
echo "/usr/local/ssl/lib" > /etc/ld.so.conf.d/openssl.conf
#备份,并链接
mv /etc/init.d/ssh /etc/init.d/ssh.old
cp -r /etc/ssh /etc/ssh.old
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
ln -s /usr/local/ssl/bin/openssl /usr/bin/
#检查版本
ldconfig -v
openssl version -a
4、安装openssh
#备份
mkdir -p /usr/local/ssh_bak/init.d
cp -r /etc/ssh /usr/local/ssh_bak/
cp -r /etc/init.d/ssh /usr/local/ssh_bak/init.d
#卸载(同时卸载配置文件)
apt-get remove openssh-server openssh-client openssh-sftp-server -y
#安装
cd /usr/local/openssh-8.4p1
#设置配置文件路径,并检查环境
./configure --prefix=/usr/local/ssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl
#编译
make
#安装
make install
网友评论