1、安装需要的包
1
|
yum -y
install
gcc*
make
perl pam pam-devel zlib-devel tcp_wrappers-devel
bzip2
-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
|
2、安装openssl
1
2
3
4
5
|
wget https:
//www
.openssl.org
/source/openssl-1
.0.2l.
tar
.gz
tar
xf openssl-1.0.2l.
tar
.gz
cd
openssl-1.0.2l
.
/config
--prefix=
/usr/local/openssl
&&
make
&&
make
install
ln
-s
/usr/local/openssl/include/openssl
/usr/include/openssl
|
3、将新编译的openssl library 加入系统动态库链接中
1
|
echo
"/usr/local/openssl/lib"
>>
/etc/ld
.so.conf
|
4、安装openssh
1
2
3
4
5
6
7
|
mv
/etc/ssh/
/etc/sshbak
wget https:
//openbsd
.hk
/pub/OpenBSD/OpenSSH/portable/openssh-7
.6p1.
tar
.gz
tar
xf openssh-7.6p1.
tar
.gz
cd
openssh-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
&&
make
install
cp
/etc/sshbak/
*
/etc/ssh/
|
注,新版本是禁止root直接登录的,要将PermitRootLogin改为yes
1
2
|
sed
-i
'/^#PermitRootLogin/s@^#@@'
/etc/ssh/sshd_config
service sshd restart
|
本文转自 baby神 51CTO博客,原文链接:http://blog.51cto.com/babyshen/1973724,如需转载请自行联系原作者