ConquerALL 2013-09-13
openssh升级到6.2p2
yum -y install pam-devel openssl-devel
安装zlib
tar zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --shared
make && make install
远程升级可以安装dropbear 替代openssh,防止丢失ssh连接,dropbear默认使用22端口,启动dropbear前 修改openssh的默认端口,或者启动加 -p 端口
下载地址:https://matt.ucc.asn.au/dropbear/releases/
(dropbear兼容性不好,我升级的redhat7.3只能使用dropbear-0.40,大家自己试试,make出错)
tar jxf dropbear-0.40.tar.bz2
./configure --prefix=/usr/local/dropbear/sbin/dropbear
make && make install
mkdir /etc/dropbear
/usr/local/dropbear/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
/usr/local/dropbear/bin/dropbearkey -t rsa -s 4096 -f /etc/dropbear/dropbear_rsa_host_key
启动dropbear
/usr/local/dropbear/sbin/dropbear (-p 端口)
tar zxf openssh-6.2p2.tar.gz
cd openssh-6.2p2
./configure --prefix=/usr --sysconfdir=/etc/ssh \
--with-pam --with-zlib --with-md5-passwords
rpm -qa | grep openssh
openssh-server×
openssh-×
rpm -e --nodeps openssh-×
rpm -e --nodeps openssh-server-×
mv /etc/ssh /etc/ssh.bak
mv /usr/bin/ssh /usr/bin/ssh.bak
make && make install
cp contrib/redhat/sshd.init /etc/rc.d/inin.d/sshd
chmod +x /etc/rc.d/inin.d/sshd
chkconfig --add sshd
不要断开ssh,启动新安装openssh
修改ssh端口,启动openssh
/etc/rc.d/init.d/sshd start
查看当前ssh版本