zoukankan      html  css  js  c++  java
  • ubuntu telnet 配置

    在Ubuntu下的telnet服务需要安装xinetd服务和telnetd服务

    1. apt-get install xinetd

    2. apt-get install telnetd

    修改/etc/inetd.conf和/etc/xinetd.conf文件并创建/etc/xinetd.d/telnet

    3. gedit /etc/inetd.conf

    添加:telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd

    注释:依次为:

    • 服务名称。和xinetd一样,inetd通过查询/etc/service获得该服务的相关信息。
    • 套接口类型。TCP用stream,UDP用dgram。
      该服务使用的通信协议。
    • inetd是否等到守护进程结束才继续接管端口。wait表示等待(相当于xinetd的wait = yes),nowait表示不等待,inetd每次接到一个请求就启动守护进程的新副本(相当于xinetd的wait = no)。
    • 运行该守护进程的用户身份。
    • 守护进程二进制文件的完整路径及其命令行参数

    4. gedit /etc/xinetd.conf

    defaults
    {
    instances = 60
    log_type = SYSLOG daemon info
    log_on_success = HOST PID
    log_on_failure = HOST
    cps = 25 30
    }
    includedir /etc/xinetd.d

    注释:

    • instances = 60:表示最大连接进程数为60个。
      log_type = SYSLOG daemon info:表示使用syslog进行服务登记。
      log_on_success= HOST PID:表示设置成功后记录客户机的IP地址的进程ID。
      log_on_failure = HOST:表示设置失败后记录客户机的IP地址。
      cps = 25 30:表示每秒25个入站连接,如果超过限制,则等待30秒。主要用于对付拒绝服务攻击。
      includedir /etc/xinetd.d:表示告诉xinetd要包含的文件或目录是/etc/xinetd.d

    5. gedit /etc/xinetd.d/telnet

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

    注释:

    • disable = no:表示启用这个服务。
      socket_type = stream:表示服务的数据包类型为stream。
      wait = no:表示不需等待,即服务将以多线程的方式运行。
      user = root:表示执行此服务进程的用户是root。
      server = /usr/bin/in.telnetd:启动程序的位置。
      log_on_failure += USERID:表示设置失败时,在/etc/xinetd.conf中设置的default值基础之上还把UID添加到系统登记表

    以上三个文件,前两个是配置xinetd的,telnet则是在xinetd里放开telnet服务用的。类debian的系统如Ubuntu里必须配置inetd.conf,而redhat通过chkconfig telnet on来放开telnet服务。

    6. service xinetd restart 重启xinetd服务(telnet服务是由xinetd守护进程来管理的)

    7. 执行命令netstat -tna 查看监听端口是否已经起来了。

    tcp 0 0 0.0.0.0:23  0.0.0.0:*    LISTEN  出现类似的这一行表示开始监听端口23

    参考:

    xinetd 配置参数:

    ubuntu <wbr>telnet <wbr>配置
    日志相关参数

    ubuntu <wbr>telnet <wbr>配置

    (以上主要参考CSDN)

  • 相关阅读:
    图像控件 ImageControl
    日期条控件 DateFieldControl
    日期选择器和日期条控件 DateChooserAndDateFieldControls
    计数器控件实例 NumericStepper
    树结构控件实例 TreeControl
    vue2.0leaflet
    关于工具类中@Autowired注入为NULL的问题记录
    zabbix_agentd重装后启动时IPC和共享内存段问题
    rsync如何不指定密码文件
    MySQL5.7 JSON类型及其相关函数的学习
  • 原文地址:https://www.cnblogs.com/sherlockhomles/p/3089186.html
Copyright © 2011-2022 走看看