对大家推荐很好使用的CentOS5.1远程控制系统之前,像让大家对CentOS5.1远程系统有所了解,然后对CentOS5.1远程升级ssh系统全面讲解介绍,CentOS5.1远程升级ssh到5.0p1 因为服务器在机房,所以不能删除ssh后再重新安装,只能升级安装希望对大家有用。
1.看看现在ssh的版本
ssh -V是4.5的,***的是5.0p1
2.去官方下载包,
然后./configure --prefix=/usr --with-pam --with-md5-passwords --sysconfdir=/etc/ssh发现老是Can't find recent OpenSSL libcrypto干脆把ssl也升级下
3.升级ssl
看下版本openssl version -aOpenSSL 0.9.8b 04 May 2006***的是h了先下载zlib-1.2.3.tar.gz安装下tar -zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3./configure --shared 不要忘了shared这个参数。make make install
CentOS5.1远程升级安装ssl tar -zxvf openssl-0.9.8h.tar.gz cd openssl-0.9.8h./config shared 一定要带共享参数哦make make test make install 这样ssl就装在/usr/local/ssl里面啦 替换系统的sslfind / -name openssl/usr/bin/openssl(原来的)
/usr/lib/openssl(原来的)
/usr/local/ssl/bin/openssl(新的)
/usr/local/ssl/include/openssl(新的)
下面开始替换了
mv /usr/bin/openssl /usr/bin/oldopenssl
mv /usr/lib/openssl /usr/lib/oldopenssl
rm -rf /usr/lib/libcrypto.so
rm -rf /usr/lib/libssl.so
ln -s /usr/local/ssl/lib/libcrytpo.so.0.9.8 /usr/lib/libcrypto.so
ln -s /usr/local/ssl/lib/libssl.so.0.9.8 /usr/lib/libssl.so
ln /usr/local/ssl/bin/openssl /usr/bin/openssl
cp -r /usr/local/ssl/lib/* /usr/lib/openssl
echo /usr/local/ssl/lib >> /etc/ld.so.conf
ldconfig -vopenssl version -aOpenSSL 0.9.8h 28 May 2008
4。CentOS5.1远程控制安装ssh
tar -zxvf openssh-5.0p1.tar.gz ./configure --with-ssl-dir=/usr/local/ssl --with-zlib --with-pam --with-md5-passwords configure: error: PAM headers not found安装下rpm -ivh ../pam-devel-0.99.6.2-3.26.el5.i386.rpm (安装盘里有)./configure --with-ssl-dir=/usr/local/ssl --with-zlib --with-pam --with-md5-passwords make make install
ssh -V OpenSSH_5.0p1, OpenSSL 0.9.8h 28 May 2008
5.CentOS5.1远程配置
vi /usr/local/etc/sshd_config Port 22 Protocol 2(建议只用2,1的有安全性问题)
ListenAddress 0.0.0.0
HostKey /usr/local/etc/ssh_host_key
HostKey /usr/local/etc/ssh_host_rsa_key
HostKey /usr/local/etc/ssh_host_dsa_key
SyslogFacility AUTH
LogLevel INFO PermitRootLogin no(安全起见不要root登录,其他用户登,然后su过去)
RhostsRASAuthentication no IgnoreRhosts yes UsePrivilegeSeparation yes
【编辑推荐】