自学内容网 自学内容网

ubuntu 24.04 安装telnet服务

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:~$ 


原文地址:https://blog.csdn.net/tjjingpan/article/details/140380787

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!