Install and use the telnet command in CentOS 6. x
1. Check whether telnet is installed in the CentOS system.
Rpm-qa | grep telnet
Telnet-0.17-48.el6.x86_64
Telnet-server-0.17-48.el6.x86_64
Telnet is mounted under xinetd, so check whether the xinetd service is installed.
Rpm-qa | grep xinetd
Xinetd-2.3.14-39.el6_4.x86_64
If neither of them is installed, yum installs the following services
Yum install xinetd telnet-server-y
2. Configure telnet
Set startup
# Chkconfig telnet on
Modify configuration file
Vi/etc/xinetd. d/telnet
Change "disable = yes" to "disable = no"
3. Activate the service
Restart the xinetd service
Service xinetd restart
Or/etc/rc. d/init. d/xinetd restart
4. the iptables firewall will block telnet, so you need to allow it in iptables by using the following command:
After you start the telnet service, you can run the netstat-tunlp command to view the port used by the telnet service. The port number is 23. Run the following command to enable these ports:
Iptables-I INPUT-p tcp -- dport 23-jACCEPT
Iptables-I INPUT-p udp -- dport 23-jACCEPT
Service iptables save // save
Service iptables restart // restart the Firewall
Or click it !! Disable firewall!
Service iptables stop
5. Use the telnet command
Format: telnet ip prot
6. Other common telnet commands:
Close current connection
Logout forces the remote user to exit and close the connection
Display parameters of the current operation
Mode tries to enter the command line mode or Character mode
Open connection to a site
Quit exit
Set sets the parameters of the current operation.
Unset reset current operation parameters
Status
Toggle switches operation parameters
Slc changes the status of special characters
Auth enable/disable validation Function z Suspension
Telnetsend sends special characters
How does telnetenviron change the environment variable? Show Help Information
VII. troubleshooting
If you use the telnet command, the following prompt is displayed:
-Bash: telnet: command not found
Check whether the telnet package is missing