centos7 升级安装openssh9.1
时间: 2023-10-22 12:01:25 浏览: 139
openssh9.1p-centos6RPM包
在CentOS 7上升级安装OpenSSH 9.1可以按照以下步骤进行:
1. 首先,确保系统已经安装了EPEL存储库。如果未安装,请运行以下命令安装:
```
sudo yum install epel-release
```
2. 然后,更新系统软件包到最新版本:
```
sudo yum update
```
3. 安装OpenSSH 9.1的依赖软件包:
```
sudo yum install gcc make wget perl-devel pam-devel zlib-devel krb5-devel openssl-devel
```
4. 下载OpenSSH 9.1的源代码包,可以在OpenSSH官方网站上获取最新的源代码包:
```
wget http://www.openssh.com/portable/openssh-9.1p1.tar.gz
```
5. 解压源代码包:
```
tar -zxvf openssh-9.1p1.tar.gz
cd openssh-9.1p1
```
6. 配置编译选项:
```
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-privsep-path=/var/empty/sshd
```
7. 编译并安装:
```
make
sudo make install
```
8. 备份并替换系统原有的OpenSSH二进制文件:
```
sudo cp /usr/sbin/sshd /usr/sbin/sshd_backup
sudo cp /usr/bin/ssh /usr/bin/ssh_backup
sudo cp /usr/bin/ssh-keygen /usr/bin/ssh-keygen_backup
sudo cp /usr/libexec/openssh/sftp-server /usr/libexec/openssh/sftp-server_backup
sudo cp /usr/libexec/openssh/sftp-server /usr/libexec/openssh/sftp-server_backup
sudo cp /usr/libexec/openssh/sftp-server /usr/libexec/openssh/sftp-server_backup
sudo cp /usr/libexec/openssh/ssh-keysign /usr/libexec/openssh/ssh-keysign_backup
sudo cp /usr/libexec/openssh/ssh-keyscan /usr/libexec/openssh/ssh-keyscan_backup
sudo cp /usr/libexec/openssh/ssh-keyscan /usr/libexec/openssh/ssh-keyscan_backup
```
9. 启动OpenSSH服务:
```
sudo systemctl start sshd
```
到此,您已成功将OpenSSH升级到9.1版本。您可以使用以下命令验证OpenSSH版本:
```
ssh -V
```
阅读全文