阅读量:3
在Linux系统中,Telnet服务允许用户通过Telnet客户端远程登录到服务器并执行命令
- 启动Telnet服务:
对于基于Systemd的系统(如Ubuntu 16.04及更高版本、CentOS 7及更高版本):
sudo systemctl start telnet.socket
对于基于SysVinit的系统(如较旧的Ubuntu和CentOS版本):
sudo service xinetd start
- 停止Telnet服务:
对于基于Systemd的系统:
sudo systemctl stop telnet.socket
对于基于SysVinit的系统:
sudo service xinetd stop
- 设置Telnet服务开机自启:
对于基于Systemd的系统:
sudo systemctl enable telnet.socket
对于基于SysVinit的系统:
sudo chkconfig xinetd on
注意:Telnet协议不安全,因为它在网络上以明文形式传输数据。建议使用更安全的替代方案,如SSH(Secure Shell)。要安装和使用SSH,请参阅以下命令:
- 安装SSH服务:
对于基于Systemd的系统:
sudo apt-get install openssh-server # Ubuntu/Debian
sudo yum install openssh-server # CentOS/RHEL
对于基于SysVinit的系统:
sudo apt-get install openssh-server # Ubuntu/Debian
sudo yum install openssh-server # CentOS/RHEL
- 启动SSH服务:
对于基于Systemd的系统:
sudo systemctl start ssh
对于基于SysVinit的系统:
sudo service sshd start
- 设置SSH服务开机自启:
对于基于Systemd的系统:
sudo systemctl enable ssh
对于基于SysVinit的系统:
sudo chkconfig sshd on
以上就是关于“Linux中Telnet服务的启动与停止”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm