OpenSSH 版本升级 Debain 系统
原文链接:https://blog.csdn.net/GF_1205/article/details/115708434
1 | OpenSSH 是 SSH (Secure SHell) 协议的免费开源实现。 |
OpenSSH 下载地址
1 | https://www.openssh.com/ |
安装前准备
1 | 请确保如果 openssh 安装失败后,还能够通过其他方式登录操作系统 |
首先我们看下自己服务器的 ssh 版本,已知现在最新版本是 9.3
1 | ssh -V |
安装依赖
1 | apt-get install -y aptitude |
备份 ssh 配置
1 | cp -rf /etc/ssh /etc/ssh.bak |
设置文件权限
1 | chmod 600 /etc/ssh/ssh_host_rsa_key |
配置 sshd 配置
1 | sed -i 's/^#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config |
配置 service, 取消 notify
1 | sed -i 's/^Type/#&/' /lib/systemd/system/ssh.service |
下载包 (我这边用了阿里云的镜像文件)
解压
1 | tar -vxf openssh-9.3p1.tar.gz?spm=a2c6h.25603864.0.0.686840adzcAlgf |
编译安装
1 | cd openssh-9.3p1 |
1 | make |
重启服务
1 | systemctl daemon-reload |
现在版本
1 | ssh -V |
其他报错
报错 1:
1 | configure: error: *** zlib.h missing - please install first or check config.log *** |
解决方式:
1 | apt-get install zlib1g-dev -y |
报错 2:
1 | configure: error: *** working libcrypto not found, check config.log |
解决方式:
1 | apt-get install openssl |
报错 3:
1 | 编译 openssh 报错 C compiler cannot create executables |
解决方式:
1 | apt --fix-broken install |
报错 4:
1 | 编译 openssh 报错 configure: error: PAM headers not found |
解决方式:
1 | apt-get install libpam0g-dev |