ubuntu12.04 安装telnet服务器

1、安装telnet
sudo apt-get install telnetd-ssl
sudo apt-get install telnetd
sudo apt-get install xinted

telnet 与 xinetd 的关系:
xinetd是新一代的 网络守护进程服务程序,
telnet进程由xinetd守护。
Ubuntu 12.04 默认不安装 xinetd。

2、修改xinetd和telnet配置文件
1) sudo vim /etc/xinetd.conf
添加红色部分。
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
# log_type = SYSLOG daemon info

        instances = 60
        log_type = SYSLOG authpriv
        log_on_success = HOST PID
        log_on_failure = HOST
        cps = 25 3
}

includedir /etc/xinetd.d

2)增加/修改 sudo vim /etc/xinetd.d/telnet
Ubuntu 12.04 默认不存在该文件。

      # default: on
      # description: The telnet server serves telnet sessions; it uses \
      # unencrypted username/password pairs for authentication.
        service telnet 
       {
         disable = no  

         Instance =UNLIMITED 
         Nice =0

         flags = REUSE
         socket_type = stream
         wait = no
         user = root
         server = /usr/sbin/in.telnetd
         log_on_failure += USERID
        }

3、重启xinetd服务

sudo /etc/init.d/xinetd  restart

4、本机登录telnet测试


light@vm-ubuntu:~$ telnet 127.0.0.1
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Ubuntu 12.04 LTS
vm-ubuntu login: 

5.Win7中需要打开Telnet服务。

在cmd窗口中,telnet 目标IP即可。

然后输入用户名和密码。



你可能感兴趣的:(嵌入式linux)