Install and configure telnet in Centos (full version, Centos5.5 test) 1. check whether telnet is installed on the local machine (telnet is installed on centOS5 by default) # rpm-qa | greptelnet if the display result is: telnet-0.17-39.el5
Install and configure telnet in Centos (for full version, Centos 5.5)
1. check whether telnet is installed on the local machine (telnet is installed on centOS5 by default)
# Rpm-qa | grep telnet
If the result is:
Telnet-0.17-39.el5
Telnet-server-0.17-39.el5
Congratulations! telnet has been installed on the machine. If no installation is available, see the next step.
Note:
Telnet can be divided into telnet-client (telnet for short) and telnet-server. Telnet-client system (CentOs 5.5) is installed by default. Telnet-server must be installed separately.
II. install telnet
Method 1 (online installation ):
You can run the following command:
# Yum install xinetd (be sure to install it under root)
# Yum install telnet-server (be sure to install it under root)
Method 2 (CD installation method ):
Cd/CentOS
Rpm-ivh xinetd-2.3.14-10.el5.i386.rpm
Rpm-ivh telnet-server-0.17-39.el5.i386.rpm
Note:
1. the telnet service depends on the xinetd service. Therefore, install the xinetd service first. Therefore, we must first install xinetd and then install telnet-server. By default, telnet and xinetd services are not installed in CentOS 5.5.
2, the CentOS-5.5-i386-bin-DVD contains xinetd and telnet-server and installation package !! No need to download online !!
3. configure telnet
Method 1: Use ntsysv. in the displayed window, select telnet and press OK!
Method 2: Use the chkconfig command to directly enable
# Chkconfig telnet on
Method 3: directly modify the configuration file
Vi/etc/xinetd. d/telnet
This is generally the case:
# Default: yes
# Description: The telnet server servestelnet sessions; it uses \
# Unencrypted username/password pairs for authentication.
Service telnet
{
Flags = REUSE
Socket_type = stream
Wait = no
User = root
Server =/usr/sbin/in. telnetd
Log_on_failure + = USERID
Disable = yes
}
Change "disable = yes" to "disable = no"
4. activate the service
Telnet is stored under xinetd. Therefore, as long as xinetd is re-activated, the settings in xinetd can be re-read. Therefore, the configured telnet is natural.
It can also be activated.
# Servicexinetd restart
Or #/etc/rc. d/init. d/xinetd restart
5. the iptables firewall will block telnet, so you must allow it in iptables by using the following command:
After you start the telnet service, can you use netstat? Tunlp command to view the port used by the telnet service, 23 can be found. 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
6. possible problems:
Let's take a look at the two errors:
First:
[Root @ linuxchao ~] # Telnet 192.168.1.87
Trying 192.168.1.87...
Telnet: connect to address 192.168.1.87: Noroute to host
Telnet: Unable to connect to remote host: No route to host
Solution: In this case, the firewall does not allow the telnet service and the connection is blocked. by default, CentOS only supports SSH, so you can enter the custom options and check the password before telnet!
Second
[Root @ test xinetd. d] # telnet 172.25.1.3
Trying 172.25.1.3...
Connected to 172.25.1.3 (172.25.1.3 ).
Escape character is '^]'.
Getnameinfo: localhost: Success
Temporary failure in name resolution: Illegal seek
Connection closed by foreign host.
This is the configuration of the/etc/hosts file.
Solution: I add two IP addresses to the address. the content is as follows:
[Linux @ localhost ~] $ More/etc/hosts
# Do not remove the following line, orvarious programs
# That require network functionality willfail.
127.0.0.1localhost.localdomainlocalhost
: 1localhost6. localdomain6localhost6
192.168.1.88
192.168.1.86
Note: The client name is not written because it is hard to remember. the content format should be 127.0.0.1 pcname.