————-镜像挂载———–
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
cd /etc/yum.repos.d
mkdir ever_repo
mv *.repo ever_repo/
vi local.repo
[name]
name="local repo"
baseurl=file:///media/cdrom/
enabeld=1
gpgcheck=0
yum clean all
yum makecache
———–安装telnet服务————
yum -y install telnet-server* telnet
vi /etc/xinetd.d/telnet (将其中disable字段的yes改为no以启用telnet服务)
mv /etc/securetty /etc/securetty.old #允许root用户通过telnet登录
service xinetd start #启动telnet服务
chkconfig xinetd on #使telnet服务开机启动,避免升级过程中服务器意外重启后无法远程登录系统
chkconfig iptables off #关闭防火墙永久
service iptables stop #即时生效,重启失效
—————正式升级——–
yum -y install gcc zlib-devel openssl-devel
上传openssh升级包
mkdir /back
mv /etc/ssh/ /back/ssh.back
tar xf openssh-7.7p1.tar.gz
cd openssh-7.7p1/
./configure –prefix=/usr –sysconfdir=/etc/ssh
make
make install
cp /root/openssh-7.7p1/contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig –add sshd
service sshd restart
vi /etc/ssh/sshd_config #(修改配置文件 PermitRootLogin yes PasswordAuthentication yes )
vi /etc/selinux/config (关闭selinux)
setenforce 0 (关闭selinux生效)
getgetenforce (验证 Permissive)
—————-验证openssh没问题后关闭telnet服务——
mv /etc/securetty.old /etc/securetty
chkconfig xinetd off
service xinetd stop
openssh7.7p1tar包