Kylin-Server-V10 编译升级安装 OpenSSH_9.8p1+OpenSSL 3.3.2+zlib1.3.1

测试镜像
Kylin-Server-V10-SP3-2403-Release-20240426-x86_64.iso

 

# 安装必备和常用软件包

yum install -y gcc gcc-c++ zlib-devel libtool autoconf automake perl perl-IPC-Cmd perl-Data-Dumper perl-CPAN

 

# 安装zlib

./configure --prefix=/usr/local/zlib
make && make install

 

# 安装openssl

./config --prefix=/usr/local/openssl
make && echo $? #输出0则代表没有错误
make -j 4 install

 

# 覆盖创建软链接

ln -sf /usr/local/openssl/include/openssl /usr/include/openssl
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -sf /usr/local/openssl/lib64/libssl.so.3 /usr/lib64/libssl.so.3
ln -sf /usr/local/openssl/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3

 

# 验证版本

openssl version -a

 

# 安装openssh

mv /etc/ssh /etc/ssh.bak
./configure --prefix=/usr/local/openssh/ --sysconfdir=/etc/ssh/ --with-ssl-dir=/usr/local/openssl/ --with-zlib=/usr/local/zlib/ --without-openssl-header-check make -j 4 && make install

 

# 从安装目录创建软连接到系统目录

ln -sf /usr/local/openssh/sbin/sshd /sbin/sshd
ln -sf /usr/local/openssh/bin/ssh /usr/bin/ssh
ln -sf /usr/local/openssh/bin/scp /usr/bin/scp
ln -sf /usr/local/openssh/bin/sftp /usr/bin/sftp
ln -sf /usr/local/openssh/bin/ssh-add /usr/bin/ssh-add
ln -sf /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen
ln -sf /usr/local/openssh/bin/ssh-keyscan /usr/bin/ssh-keyscan

 

# 验证

systemctl status sshd
sshd -V

 

posted @ 2024-09-12 10:41  剑小秀  阅读(441)  评论(0编辑  收藏  举报