How can the telnet port be changed in Linux?
To change the telnet port, you need to edit the configuration file of the telnet server. Here are the steps to modify the telnet port on a Linux system:
- Open the terminal and log in to the system as a root user.
- the configuration file for the inet super server
- The telnet configuration file located in the directory /etc/xinetd.d.
sudo vim /etc/inetd.conf
- Connect to a remote server using the Telnet protocol.
- telnet daemon
telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd
- connect to a remote computer via telnet
- A program that provides the telnet service.
- Esc (pronounced eh-sk)
- Save and exit
- Restart the telnet server. Depending on your Linux distribution, use one of the following commands to restart the telnet server:
sudo service telnet restart
sudo systemctl restart telnet
sudo /etc/init.d/inetd restart
- Please verify if the port has been successfully changed. You can use the telnet command to test the new telnet port. For example, use the following command to connect to the new telnet port:
telnet localhost <新端口号>
Please be aware that telnet is an insecure remote access protocol as it transmits data in plain text. To enhance system security, it is recommended to use more secure remote access protocols, such as SSH.