在CentOS系统中,Telnet服务通常使用xinetd或inetd来管理。以下是启动和停止Telnet服务的步骤:
xinetd 管理 Telnet 服务检查 xinetd 服务状态:
sudo systemctl status xinetd
启动 xinetd 服务:
sudo systemctl start xinetd
停止 xinetd 服务:
sudo systemctl stop xinetd
启用 xinetd 服务开机自启:
sudo systemctl enable xinetd
禁用 xinetd 服务开机自启:
sudo systemctl disable xinetd
inetd 管理 Telnet 服务检查 inetd 服务状态:
sudo systemctl status inetd
启动 inetd 服务:
sudo systemctl start inetd
停止 inetd 服务:
sudo systemctl stop inetd
启用 inetd 服务开机自启:
sudo systemctl enable inetd
禁用 inetd 服务开机自启:
sudo systemctl disable inetd
xinetd 以管理 Telnet 服务如果你使用的是 xinetd,还需要在 /etc/xinetd.d/ 目录下找到或创建一个名为 telnet 的文件,并进行相应的配置。
编辑 telnet 配置文件:
sudo vi /etc/xinetd.d/telnet
配置文件示例:
service telnet
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
重启 xinetd 服务以应用更改:
sudo systemctl restart xinetd
通过以上步骤,你可以在 CentOS 系统中启动和停止 Telnet 服务,并根据需要进行配置。