openssh9.0p1在线安装
安装前,我们可以检测系统是否自带安装 MySQL:
查看版本
ssh -V
下载
wget https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz
备份与环境:
yum install -y pam* zlib* openssl-devel gcc make
cd openssh-9.0p1
cp -r /etc/ssh /tmp/
setenforce 0
sed -i 's/enforcing/disabled/g' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
必要依赖:
yum -y install zlib zlib-devel
yum install -y openssl-devel
yum -y install pam-devel
编译安装:
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-zlib --with-pam --without-openssl-header-check --with-ssl-dir=/usr/local/ssl --with-privsep-path=/var/lib/sshd
[root@localhost openssh-9.0p1]# make
[root@localhost openssh-9.0p1]# rpm -e --nodeps `rpm -qa | grep openssh`
[root@localhost openssh-9.0p1]# rm -rf /etc/ssh/*
[root@localhost openssh-9.0p1]# make install
[root@localhost openssh-9.0p1]# sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
基于systemctl管理:
[root@bogon openssh-9.0p1]# cp -a contrib/redhat/sshd.init /etc/init.d/sshd
[root@bogon openssh-9.0p1]# chkconfig sshd on
[root@bogon openssh-9.0p1]# chkconfig --add sshd
[root@bogon openssh-9.0p1]# systemctl enable sshd
[root@bogon openssh-9.0p1]# systemctl restart sshd
验证:
ssh -V