升级openssh和openssl

客户这里服务器扫出来了openssh漏洞,须要升级一下,记录以备查用node

中止sshd                service sshd stop服务器

执行卸载(若是是远程的话最好先把telnet打开,以防升级不成功远程登陆不了了,在本身内网的话打不了在yum装一下ssh,无所谓了):ssh

#rpm -e openssh --nodeps
#rpm -e openssh-server --nodeps
#rpm -e openssh-clients --nodeps
#rpm -e openssh-askpass-gnome
#rpm -e openssh-askpass
 socket

这里卸载以前最好把/etc/init.d/下面的sshd的启动脚本备份一下,等下编译安装完以后咱们直接能够使用这个脚本了ide

安装新的稳定版的ssl测试

tar -zxvf openssl-1.0.1b.tar.gzdebug

cd openssl-1.0.1b调试

#./config shared zlib
#make
#make test
#make install
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFF
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl

配置库文件搜索路径

#echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#ldconfig -v

查看openssl的版本号,以验正是否安装正确

#openssl version -a
 server

下载最新稳定版的opensshmd5

tar -zxvf openssh-6.0p1.tar.gz

cd openssh-6.0p1

#./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-ssl-dir=/usr/local/ssl --with-md5-passwords --mandir=/usr/share/man
#make
#make install



查看openssh版本号,验正安装结果

# ssh -v
 

启动并验正服务的开启情况 调试启动,若是如下显示均正常,就能够正常启动sshd了。 #/usr/sbin/sshd -d debug1: sshd version OpenSSH_4.6p1 debug1: private host key: #0 type 0 RSA1 debug1: read PEM private key done: type RSA debug1: private host key: #1 type 1 RSA debug1: read PEM private key done: type DSA debug1: private host key: #2 type 2 DSA debug1: rexec_argv[0]=’/usr/sbin/sshd’ debug1: rexec_argv[1]=’-d’ socket: Address family not supported by protocol debug1: Bind to port 22 on 0.0.0.0. Server listening on 0.0.0.0 port 22. Generating 768 bit RSA key. RSA key generation complete. 启动服务 #/usr/sbin/sshd 查看监听端口中是否有22 #netstat -tnlp | grep :22 而后ssh登陆测试一下

相关文章
相关标签/搜索