1.安装inetd

$ sudo apt-get install openbsd-inetd

2.安装xinetd 和 Telnet

$ sudo apt-get install xinetd telnet

3.配置telnet

$ sudo vim /etc/inetd.conf

输入:

telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd

$ sudo vim /etc/xinetd.conf

在#log_type = SYSLOG daemon info下面添加内容:

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

# sudo vim /etc/xinetd.d/telnet

输入以下内容:

# default: on   
# description: The telnet server serves telnet sessions; it uses \   
# unencrypted username/password pairs for authentication.   
service telnet   
{   
disable = no   
flags = REUSE   
socket_type = stream   
wait = no   
user = root   
server = /usr/sbin/in.telnetd   
log_on_failure += USERID   
}  


4.重启inetd服务,xinetd服务

$ sudo /etc/init.d/openbsd-inetd restart /etc/init.d/xinetd restart

5.查看telnet是否开启

$ sudo netstat -utlp

返回  ....*:telnet*.....    

6.试用一下

$ telnet localhost

正常返回

Logo

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。

更多推荐