ubuntu 24.04 安装telnet服务

avatar
作者
筋斗云
阅读量:0

1.安装telnet客户端

$sudo apt-get install telnet

2.安装telnet服务器

$sudo apt-get instlal telnetd

3.安装网络守护进程服务程序来管理telnet服务

$sudo apt-get install xinetd

4.修改配置文件inetd.conf

$sudo vi /etc/inetd.conf telnet stream tcp nowait telnetd /usr/sbin/tcpd/ /usr/sbin/in.telnetd telnet stream tcp nowait root   /usr/sibn/tcpd/ /usr/sbin/in.telnetd 

5.修改配置文件xinetd.conf

vi /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 30  }  includedir /etc/xinetd.d 

6.修改/etc/xinetd.d/telnet配置文件,注意server = /usr/sbin/telnetd,不是。in.telnetd

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

7.开启服务

$sudo /etc/init.d/xinetd restart

8.查看服务,显示服务器正在监听

 netstat -a |grep telnet tcp6       0      0 [::]:telnet             [::]:*                  LISTEN      

9.尝试连接本机,输入用户名、密码后连接成功

$ telnet localhost Trying 127.0.0.1... Connected to localhost. Escape character is '^]'.  Linux 6.8.0-38-generic (ernest-laptop) (pts/11)  ernest-laptop 用户名: tjjingpan 密码:  Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-38-generic x86_64)   * Documentation:  https://help.ubuntu.com  * Management:     https://landscape.canonical.com  * Support:        https://ubuntu.com/pro  扩展安全维护(ESM)Applications 未启用。  55 更新可以立即应用。 要查看这些附加更新,请运行:apt list --upgradable  启用 ESM Apps 来获取未来的额外安全更新 请参见 https://ubuntu.com/esm 或者运行: sudo pro status  tjjingpan@ernest-laptop:~$  

广告一刻

为您即时展示最新活动产品广告消息,让您随时掌握产品活动新动态!