在Linux系统中,Telnet服务允许用户通过Telnet客户端远程登录到服务器并执行命令
对于基于Systemd的系统(如Ubuntu 16.04及更高版本、CentOS 7及更高版本):
sudo systemctl start telnet.socket
对于基于SysVinit的系统(如较旧的Ubuntu和CentOS版本):
sudo service xinetd start
对于基于Systemd的系统:
sudo systemctl stop telnet.socket
对于基于SysVinit的系统:
sudo service xinetd stop
对于基于Systemd的系统:
sudo systemctl enable telnet.socket
对于基于SysVinit的系统:
sudo chkconfig xinetd on
注意:Telnet协议不安全,因为它在网络上以明文形式传输数据。建议使用更安全的替代方案,如SSH(Secure Shell)。要安装和使用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
对于基于Systemd的系统:
sudo systemctl start ssh
对于基于SysVinit的系统:
sudo service sshd start
对于基于Systemd的系统:
sudo systemctl enable ssh
对于基于SysVinit的系统:
sudo chkconfig sshd on