Centos 开启telnet-service服务

摘要:
[ loong@localhost~]$rpm qa|greptelnettelnet-0.17-39.9el53.安装telnet服务器。如果系统已安装,请跳过此步骤。方法1:在以下位置下载RPMresourcetelnet服务器:http://rpmfind.net/linux/rpm2html/search.php?或者使用以下方法允许root用户登录到telnet:方法1:#mv/etc/securetty/etc/securetty Bak(不建议使用此方法。测试后将其改回!)或者尝试先使用root用户登录,然后检查系统日志:telnet˃olocalhostTrying127.0.0.1…Connectedto localhost。本地域。转义符“^]”。CentOSrelease5.8内核2.6.18-308.1.1.el5onani686login:root密码:登录正确登录:登录错误登录:连接已保存root@localhostloong]#tail-20/var/log/secureApr2417:32:58本地主机登录:pam_ securetty:访问被拒绝:tty'pts/1'不安全!因此,将“pts/1”添加到/etc/secretty以实现telnet根登录。

Centos 开启telnet-service服务

1. 查看linux版本信息:

[loong@localhost ~]$ cat /etc/issue CentOS release 5.8 (Final) Kernel 
 on an m

2. 查看系统是否已安装telnet-server,linux系统上默认已经安装telnet-client(或telnet),而telnet-server需要手动安装。

[loong@localhost ~]$ rpm -qa | grep telnet telnet-0.17-39.el5

3. 安装telnet-server,若系统已安装,跳过此步。

方法一:下载RPM resource telnet-server,下载地址:http://rpmfind.net/linux/rpm2html/search.php?query=telnet-server

选择相应版本的telnet-server下载;

安装:# rpm -i telnet-server-0.17-39.el5.i386.rpm  #貌似还得单独安装xinetd.

方法二:(推荐使用)

# yum install telnet-server 

安装完成后:

[loong@localhost ~]$ rpm -qa | grep telnet telnet-0.17-39.el5 telnet-server-0.17-39.el5

4. 启动telnet服务

方法一:System->Administration->Services 中,

在On Demand Services中选中telnet,

并在Background Services中选中xinetd,并点击上面的Start,即在右侧显示:xinetd (pid  15986) is running...

最后Save & Quit.

方法二:编辑/etc/xinetd.d/telnet, 将其中的 disable = yes 的yes改为no.

修改后:

复制代码
# default: on # description: The telnet server serves telnet sessions; it uses  #       unencrypted username/password pairs for authentication. service telnet {         disable = no         flags           = REUSE         socket_type     = stream         wait            = no         user            = root         server          = /usr/sbin/in.telnetd         log_on_failure  += USERID }
复制代码

方法三:使用chkconfig命令直接开启

[root@localhost loong]# chkconfig telnet on

注:方法二和方法三,需要激活xinetd服务。方法如下:

[root@localhost loong]# service xinetd restart Stopping xinetd:                                           [  OK  ] Starting xinetd:                                           [  OK  ]

或:

[root@localhost loong]# /etc/rc.d/init.d/xinetd restart Stopping xinetd:                                           [  OK  ] Starting xinetd:                                           [  OK  ]

5. 测试服务

复制代码
[root@localhost loong]# telnet localhost Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. CentOS release 5.8 (Final) Kernel 2.6.18-308.1.1.el5 on an i686 login: loong Password:  Last login: Tue Apr 24 16:42:06 from 10.108.14.135 [loong@localhost ~]$ exit logout  Connection closed by foreign host. [root@localhost loong]# 
复制代码

注:默认情况下,系统只允许普通用户telnet登录,不允许root用户登录。

要想获得root权限,可以使用普通用户登录,然后执行su,来获得root权限。

或使用一下方法,允许root登录telnet:

方法一:# mv /etc/securetty /etc/securetty.bak (不建议这种方法,测试完后再改回去吧!)

或先试图使用root用户登录,不成功,然后查看系统log:

复制代码
telnet> o localhost Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. CentOS release 5.8 (Final) Kernel 2.6.18-308.1.1.el5 on an i686 login: root Password:  Login incorrect  login:      Login incorrect  login:  Login incorrect  login:  Connection closed by foreign host. [root@localhost loong]# tail -20 /var/log/secure Apr 24 17:32:58 localhost login: pam_securetty(remote:auth): access denied: tty 'pts/1' is not secure ! Apr 24 17:33:03 localhost login: FAILED LOGIN 1 FROM localhost FOR root, Authentication failure
复制代码

可以看到 access denied: tty 'pts/1' is not secure !

所以将‘pts/1’添加到/etc/securetty中,即可实现telnet的root用户登录。至于为什么?暂不清楚。

方法二:修改/etc/pam.d/remote,注释掉:auth       required     pam_securetty.so

1 #%PAM-1.0 2 #auth       required     pam_securetty.so 3 auth       include      system-auth

注:不建议开放telnet的root登录,容易带来安全隐患。

 

参考连接:

1. http://wenku.baidu.com/view/105544aedd3383c4bb4cd23d.html

2. win7下使用telnet命令:http://wenku.baidu.com/view/f0ff731152d380eb62946d9d.html

免责声明:文章转载自《Centos 开启telnet-service服务》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇点击div掉下和上升Apache Spark2.0正式发布下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

服务器架设:CentOS搭建LNMP详细教程(转)

目前流行的配置是Linux+Nginx+PHP+MySQL,简称LNMP。下面简单介绍一下配置方法。 一、安装CentOS和LNMP包。 安装CentOS 5.5,系统安装完后自带APACHE,先运行yum remove httpd,删除Apache! 用SSH登录LINUX,安装LNMP。 1、下载LNMP一键安装包: wget -c http://so...

centos安装图形化界面 和 安装火狐浏览器

yum groupinstall "Desktop"yum groupinstall "X Window System"yum groupinstall "Chinese Support" startx                   安装火狐浏览器:http://www.centoscn.com/image-text/install/2014/111...

十分钟上手-搭建vue开发环境(新手教程)

想写一些关于vue的文章已经很久了,因为这个框架已经火了很久,在公司里用的框架都比较老旧,但怎么也得跟上前端发展变化的潮流,这不,开始使用vue开发项目了,一遍开发一边踩坑中,今天要记录的是五分钟搭建vue开发环境,运行GitHub上的开源项目。步骤很简单,只是在搭建环境的过程中会遇到各种各样奇怪的报错,十分让人头疼。 1:安装node 端开发框架和环境都...

CentOS 服务器间文件同步

配置文件同步服务器,作为向其他服务器提供同步服务1、首先要安装xinetdyum -y install xinetd2、 rsync一般默认是安装的3、vim /etc/xinetd.conf,将其中的disable = yes改成disable = no3、vim /etc/rsyncd.conf (注意此文件原来没有,直接编写即可)#rsyncuid=...

谈谈localhost与127.0.0.1

localhost意为本地主机,指这台计算机,是给回路网络接口的标准主机名,对应的IP地址为127.0.0.1,可访问本地服务器的web项目(http://localhost)。 那么它们有什么区别呢?   localhost不通过网卡传输,不受防火墙和网卡限制;而127.0.0.1则依赖于网卡,会受到防火墙和网卡的限制。   localhost访问时带着...

mysql默认安装目录说明

MySQL安装完成后不象SQLServer默认安装在一个目录,它的数据库文件、配置文件和命令文件分别在不同的目录,了解这些目录非常重要,尤其对于Linux的初学者,因为Linux本身的目录结构就比较复杂,如果搞不清楚MySQL的安装目录那就无从谈起深入学习。 下面就介绍一下这几个目录。1、数据库目录/var/lib/mysql/2、配置文件/usr/sha...