openssh 升级到8.2版本 (Linux 7)

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 (可以不卸载)(openssl使用是系统自带的)

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 make && make install

11 chmod 600 /etc/ssh/ssh_host_* 赋予指定权限

12 install -v -m755 contrib/ssh-copy-id /usr/bin

13 install -v -m644 contrib/ssh-copy-id.1 /usr/share/man/man1

14 install -v -m755 -d /usr/share/doc/openssh-8.2p1

15 install -v -m644 INSTALL LICENCE OVERVIEW README* /usr/share/doc/openssh-8.2p1

16 echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config

17 echo 'UsePAM yes' >> /etc/ssh/sshd_config

18 cp -p contrib/redhat/sshd.init /etc/init.d/sshd

19 chmod +x /etc/init.d/sshd

20  chkconfig --add sshd

21 mv /usr/lib/systemd/system/sshd.service /opt/

22 chkconfig sshd on

23 chkconfig --list sshd

24 systemctl restart sshd

原文地址:https://www.cnblogs.com/MUQINGFENG123/p/13208975.html