您的位置:首页 > 其它

WED MAY 20,2009

2009-05-20 16:45 190 查看
今天第一次使用 UBUNTU下的TELNET,打开终端,输入telnet 主机IP 后,提示Connection refused。后天在BAIDU中看到这样一篇文章:

首先安装xinetd(它是inetd替代品):
sudo apt-get install xinetd
再安装telnetd,在Ubuntu中没有telnetd这个软件包,它是包含在inetutils-telnetd软件包中:
sudo apt-get install inetutils-telnetd
在/etc/xinetd.d目录下新建文件,名称为telnet,内容为:
# default: off

# description: Telnet service which is the interface of remote access.
# This is the tcp version.I omited the UDP's.

service telnet

{

socket_type = stream

protocol = tcp

wait = no

user = root

server = /usr/sbin/telnetd

disable = no

}
重新启动xinetd:
sudo /etc/init.d/xinetd restart
在终端查看telnet服务有没有打开:
netstat -ta | grep telnet
输出可能如下:
tcp 0 0 *:telnet *:* LISTEN

说明telnet已启动.
现在先在本地测试一下,如图:

再在Windows平台下测试一下,如图:

若只允许在局域网内的机器访问,则可在/etc/hosts.allow文件中添加所在局域网的IP段地址或网络组:
# /etc/hosts.allow: list of hosts that are allowed to access the system.

# See the manual pages hosts_access(5) and hosts_options(5).

#

# Example: ALL: LOCAL @some_netgroup

# ALL: .foobar.edu EXCEPT terminalserver.foobar.edu

#

# If you're going to protect the portmapper use the name "portmap" for the

# daemon name. Remember that you can only use the keyword "ALL" and IP

# addresses (NOT host or domain names) for the portmapper, as well as for

# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)

# for further information.

#





照着操作,果然可以了,哈哈
参考网站:http://hi.baidu.com/chenfeng2006/blog/item/cacac65887da9786800a18d1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: