1 yum -y install telnet*
2 yum -y install xinetd*
3 vim /etc/securetty 添加如下:
pts/1
pts/2
pts/3
pts/4
pts/5
4 vim /etc/xinetd.d/telnet
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server =/usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}
5 systemctl restart xinetd.service
解压编译
6 tar -zxvf openssh-8.2p1.tar.gz
7 rpm -e `rpm -qa | grep openssh` --nodeps 卸载openssh (可以不卸载)
8 yum -y install gcc* pam* pam-devel zlib* zlib-devel openssl-devel 安装必备的安装包
9 ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-zlib --with--ssl-dir=/usr/local/ssl --with-privsep-path=/var/lib/sshd
10 chmod 600 /etc/ssh/ssh_host_* 赋予指定权限
11 install -v -m755 contrib/ssh-copy-id /usr/bin
12 install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1
13 install -v -m755 -d /usr/share/doc/openssh-8.2p1
14 install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.2p1
15 echo ‘PermitRootLogin yes‘ >> /etc/ssh/sshd_config
16 echo ‘UsePAM yes‘ >> /etc/ssh/sshd_config
17 cp -p contrib/redhat/sshd.init /etc/init.d/sshd
18 chmod +x /etc/init.d/sshd
19 chkconfig --add sshd
20 mv /usr/lib/systemd/system/sshd.service /opt/
21 chkconfig sshd on
22 chkconfig --list sshd
23 systemctl restart sshd