2024-07-05 04:32:08
05 07 2024
摘要:Ubuntu升级openssh

 
1.安装编译环境
sudo apt install gcc
sudo apt install make
2.安装zlib
tar zxvf zlib-1.3.1.tar.gz  #解压
cd zlib-1.3.1/  #
./configure --shared  #
sudo make 
sudo make install
 
3.安装openssl 
tar zxvf openssl-3.2.2.tar.gz  #解压
cd openssl-3.2.2
 
sudo ./config shared  --prefix=/usr/local
sudo make
sudo make install
 
sudo ln -fs /usr/local/lib64/libssl.so.3  /lib/x86_64-linux-gnu/libssl.so.3 
sudo ln -fs /usr/local/lib64/libcrypto.so.3  /lib/x86_64-linux-gnu/libcrypto.so.3 
sudo ln -fs /usr/local/bin/openssl /usr/bin/openssl 
sudo ln -fs /usr/local/lib64/libssl.so.3 /usr/lib/libssl.so.3
 
4.安装openssh
tar zxvf openssh_9.6p1.orig.tar.gz  #解压
sudo ./configure --sysconfdir=/etc/ssh
sudo make
sudo make install
 
sudo ln -fs /usr/local/sbin/sshd /usr/sbin/sshd
//删除掉ssh.service文件
sudo mv /usr/lib/systemd/system/ssh.service /etc/ssh_bak
5.修改/etc/ssh/sshd_config
Subsystem       sftp /usr/local/libexec/sftp-server
6.重启服务
sudo systemctl daemon-reload 
sudo systemctl restart sshd

延伸阅读
  1. 上一篇:JDK
  2. 下一篇:Nginx
发表评论