telnet server is a server software used for remote login in CentOS 7.0 system. This article will provide a detailed guide on how to install a telnet server on CentOS 7.0 and answer some commonly asked questions.
In order to install telnet server, we need to make sure that the telnetserver package is already installed on the system. You can use the following command to check if it is installed:
rpm qa | grep telnetserver
If it is not installed, you can use the following command to install it:
sudo yum install telnetserver
After the installation, we need to start the telnet service and enable it to start on boot. You can achieve this by using the following command:
sudo systemctl start telnet.socket
sudo systemctl enable telnet.socket
Next, we need to configure the telnet service. The configuration file is located in the /etc/xinetd.d/ directory and the file name is telnet. You can open the configuration file using the following command:
sudo vi /etc/xinetd.d/telnet
The content of the configuration file is as follows:
service telnet{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/telnetd
log_on_failure += USERID
disable = no
}
The meaning of each parameter is as follows:
flags: Service flag, REUSE means the port can be reused.
socket_type: Socket type, stream means using TCP protocol.
wait: Whether to wait for client connection, no means no waiting.
user: The username running the telnet service, default is root.
server: The executable file path of the telnet service, default is /usr/sbin/telnetd.
log_on_failure: The information logged on login failure, +=USERID means recording user ID.
disable: Whether to disable the telnet service, no means enabled.
According to the actual requirements, you can modify the parameters in the configuration file. If you need to restrict only specific IP addresses of clients to connect, you can add the only_from parameter in the configuration file as shown below:
service telnet{
...
only_from = 192.168.1.0/24
...
}
After saving the configuration file, you need to restart the xinetd service to make the configuration take effect:
sudo systemctl restart xinetd
Now, the telnet server is successfully installed and configured. You can test if the telnet service is working properly by using the following command:
telnet localhost
If you can successfully connect and see the welcome message, it means that the telnet service is running properly.
A1: You can use the following command to check the running status of the telnet service:
sudo systemctl status telnet.socket
A2: You can add the no_access parameter in the telnet service configuration file to specify the IP address or subnet to deny connections. For example, to deny connections from the 192.168.2.0/24 subnet:
service telnet{
...
no_access = 192.168.2.0/24
...
}
After saving the configuration file, restart the xinetd service to make the configuration take effect:
sudo systemctl restart xinetd
That's all for the installation and configuration of telnet server. If you have any further questions, feel free to ask and leave a comment. Thank you for reading!
Don't forget to comment, follow, like, and thank you for watching!