1、查看是否安装telnet


rpm -qa|grep telnet
rpm -qa|grep xinetd


2、从别的系统上使用ftp或者scp进行拷贝telnet
ftp 135.191.27.195


mget telnet-server-0.17-47.el6_3.1.x86_64.rpm telnet-0.17-47.el6_3.1.x86_64.rpm



rpm -ivh xinetd-2.3.14-38.el6.x86_64.rpm


rpm -ivh telnet-0.17-47.el6_3.1.x86_64.rpm


rpm -ivh telnet-server-0.17-47.el6_3.1.x86_64.rpm



3、修改配置文件


  (1)修改系统安全配置文件


    mv /etc/securetty /etc/securetty.bak


  (2)修改telnet配置文件


    1.vi /etc/xinetd.d/telnet


将disable改为no


    2.vi /etc/pam.d/login


将pam_securetty.so这一行加上注释



   (3)重启Xinetd服务


      service xinetd restart
(注:此时退出ssh登录协议,用telnet登录)


4.开始升级SSH服务   (保证此服务器上openssh-6.7p1.tar.gz openssl-1.0.1h.tar.gz zlib-1.2.8.tar.gz这三个tar包文件,如没有就用scp,ftp上传与下载)


service sshd stop


cp /etc/init.d/sshd  /root/


rpm -e openssh --nodeps


rpm -e openssh-server --nodeps


rpm -e openssh-clients --nodeps


rpm -e openssh-askpass


chmod -R 777 *


cd /mnt


tar -zxvf zlib-1.2.8.tar.gz


cd zlib-1.2.8


./configure


make


make install


cd /mnt


tar -zxvf openssl-1.0.1h.tar.gz


cd openssl-1.0.1h


./config shared zlib


make


make install


mv /usr/bin/openssl /usr/bin/openssl.1FF


mv /usr/include/openssl /usr/include/openssl.1FF


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


/sbin/ldconfig -v


mv /etc/ssh /etc/ssh_bak


cd /mnt


tar -zxvf openssh-6.7p1.tar.gz


cd openssh-6.7p1


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


make


make install


cp -p contrib/redhat/sshd.init /etc/init.d/sshd


chmod +x /etc/init.d/sshd


chkconfig --add sshd


cp sshd_config /etc/ssh/sshd_config


y


cp sshd /usr/sbin/sshd


y



5.重启SSH服务并检查版本是否有改变


service sshd restart



ssh -V


6.关闭telnet(参考前面打开telnet服务的步骤反之)
mv /etc/securetty.bak /etc/securetty


vi /etc/xinetd.d/telnet


vi /etc/pam.d/login


service xinetd restart