Ubuntu--开启TELNET服务

1 sudo apt-get install xinetd telnetd
安装成功后,系统也会有相应提示, 测试安装完之后就可以Telnet,要是还不行继续

2 sudo vi /etc/inetd.conf  并加入以下一行
telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd


3  sudo vi /etc/xinetd.conf  并加入以下内容:

1 # Simple configuration file for xinetd
2 #
3 # Some defaults, and include /etc/xinetd.d/
4
5 defaults
6 {
7
8 # Please note that you need a log_type line to be able to use log_on_success
9 # and log_on_failure. The default is the following :
10 # log_type = SYSLOG daemon info
11
12
13 instances = 60
14 log_type = SYSLOG authpriv
15 log_on_success = HOST PID
16 log_on_failure = HOST
17 cps = 25 30
18 }
19
20 includedir /etc/xinetd.d

4. sudo vi /etc/xinetd.d/telnet并加入以下内容:

1 # default: on
2 # description: The telnet server serves telnet sessions; it uses \
3 # unencrypted username/password pairs for authentication.
4 service telnet
5 {
6 disable = no
7 flags = REUSE
8 socket_type = stream
9 wait = no
10 user = root
11 server = /usr/sbin/in.telnetd
12 log_on_failure += USERID
13 }
14

5. 重启机器或重启网络服务sudo /etc/init.d/xinetd restart


6. 使用TELNET客户端远程登录即可进行非root用户访问。


7.使用root登录: mv /etc/securetty /etc/securetty.bak 这样root可以登录了。也可这样:
修改/etc/pam.d/login这个文件。只需将下面一行注释掉即可。
#auth required lib/security/pam_securetty.so


摘自:http://blog.csdn.net/dos5gw/archive/2010/08/04/5788097.aspx

posted on 2010-12-14 23:22  Sturtle  阅读(887)  评论(0编辑  收藏  举报