如何使用telnet连接linux主机 |
作者:马鹏 归档:学习笔记 2017/8/1 |
telnet连接linux服务器
1.1 检查系统是否安装telnet服务
[root@localhost etc]# rpm -qa |grep telnet rpm –qa 查看软件是否安装
telnet-server-0.17-48.el6.x86_64
1.2 没有安装使用yum安装即可
[root@localhost xinetd.d]# yum install telnet-server 安装telnet服务
1.3 检查telnet当前状态
[root@localhost etc]# chkconfig |grep telnet
telnet: off
如果为off需要将其改为on
[root@localhost xinetd.d]# chkconfig telnet on
[root@localhost xinetd.d]# chkconfig |grep telnet
telnet: on
1.4 重启xinetd服务
[root@localhost xinetd.d]# /etc/init.d/xinetd restart 重启xinetd服务
Stopping xinetd: [FAILED]
Starting xinetd: [ OK ]
1.5 关闭防火墙
[root@localhost ~]# /etc/init.d/iptables stop 关闭防火墙
[root@localhost ~]# /etc/init.d/iptables status 检查状态
iptables: Firewall is not running.
1.6 因为linux默认不容许 root用户以telnet方式登录系统,需要改/etc/securetty
[root@localhost etc]# mv securetty securetty.bak
将securetty重命名后即可使用root来登陆
1.7 检查root是否可以用telnet登陆
localhost.localdomain login: root
Password:
Last login: Sun Jul 30 22:59:36 from 10.0.0.1
[root@localhost ~]# ls
anaconda-ks.cfg index.html install.log install.log.syslog
[root@localhost ~]# pwd
/root
转载于:https://blog.51cto.com/oldma/2044392