歡迎您光臨本站 註冊首頁

Ubuntu中Telnet的使用

←手機掃碼閱讀     火星人 @ 2014-03-26 , reply:0

首先安裝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.
#

[火星人 ] Ubuntu中Telnet的使用已經有471次圍觀

http://coctec.com/docs/linux/show-post-178248.html