1、安装需要的包yum-yinstallgcc*makeperlpampam-develzlib-develtcp_wrappers-develbzip2-developenssl-develncurses-develsqlite-develreadline-develtk-devel
2、安装opensslwget/source/openssl-1.0.2l.tar.gz
tarxfopenssl-1.0.2l.tar.gz
cdopenssl-1.0.2l
./config--prefix=/usr/local/openssl&&make&&makeinstall
ln-s/usr/local/openssl/include/openssl/usr/include/openssl
3、将新编译的openssl library 加入系统动态库链接中echo"/usr/local/openssl/lib">>/etc/ld.so.conf
4、安装opensshmv/etc/ssh//etc/sshbak
wgethttps://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-7.6p1.tar.gz
tarxfopenssh-7.6p1.tar.gz
cdopenssh-7.6p1
./configure--prefix=/usr--sysconfdir=/etc/ssh--with-pam--with-ssl-dir=/usr/local/openssl--with-md5-passwords--mandir=/usr/share/man--with-kerberos5=/usr/lib64/libkrb5.so
make&&makeinstall
cp/etc/sshbak/*/etc/ssh/
注,新版本是禁止root直接登录的,要将PermitRootLogin改为yessed-i'/^#PermitRootLogin/s@^#@@'/etc/ssh/sshd_config
servicesshdrestart