标签:net enable 方案 res 回退 连接 rest yum grep
wget https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
安装telnet,防止openssh安装失败导致无法连接服务器
yum install -y telnet-server xinetd
echo -e 'pts/0\npts/1\npts/2\npts/3' >>/etc/securetty
systemctl enable xinetd.service
systemctl enable telnet.socket
systemctl start telnet.socket
systemctl start xinetd
连接方式:telnet ip
然后输入用户名和密码
rpm -e `rpm -qa | grep openssh` --nodeps
检查是否还有openssh的包
rpm -qa|grep openssh
yum -y install gcc pam pam-devel zlib zlib-devel openssl-devel
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-zlib --with-ssl-dir=/usr/local/ssl --with-privsep-path=/var/lib/sshd
make
make install
make install时可能报错
Permissions 0640 for '/etc/ssh/ssh_host_ed25519_key' are too open.
解决方案:chmod 600 /etc/ssh/ssh_host_*
后续配置操作:
install -v -m755 contrib/ssh-copy-id /usr/bin
install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1
install -v -m755 -d /usr/share/doc/openssh-8.0p1
install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.0p1
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
echo 'UsePAM yes' >> /etc/ssh/sshd_config
cp -p contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
chkconfig --list sshd
systemctl restart sshd
vi /etc/securetty,并删除新增的四行
pts/0
pts/1
pts/2
pts/3
停止telnet服务
systemctl stop telnet.socket
systemctl disable telnet.socket
systemctl stop xinetd.service
systemctl disable xinetd.service
如果需要删除telnet和xinetd
标签:net enable 方案 res 回退 连接 rest yum grep
原文地址:https://www.cnblogs.com/obed/p/11594237.html