Installation and configuration of Telnet under CentOS (full version, Centos5.5 Pro test)
I. Check if there is a telnet installed on the machine (CentOS5 has Telnet installed by default)
# Rpm-qa |grep Telnet
If you see the result as:
Telnet-0.17-39.el5
Telnet-server-0.17-39.el5
Congratulations, Telnet is already installed on the machine. If it is not installed, see the next step.
Special Note:
Telnet is divided into telnet-client (telnet) and telnet-server. The Telnet-client system (CentOs 5.5) is generally installed by default. Telnet-server need to be installed separately.
Second, install Telnet
First method (online installation):
You can use the command:
#yum Install xinetd (Note the installation under root)
#yum Install Telnet-server (Note the installation under root)
The second method (CD-ROM installation method):
CD/CD/centos
RPM-IVH xinetd-2.3.14-10.el5.i386.rpm
RPM-IVH telnet-server-0.17-39.el5.i386.rpm
Special Note:
1, Telnet service to rely on XINETD services to start, so first install the XINETD service. So we need to install XINETD First, then install Telnet-server. CentOS 5.5 does not have Telnet and xinetd services installed by default.
2, Centos-5.5-i386-bin-dvd inside has xinetd and Telnet-server and installs the package!! No need to download the internet!!
Three. Configure Telnet
Method One: Use Ntsysv, in the window that appears, the Telnet is selected, and then press OK!
Method Two: Use the Chkconfig command to open directly
#chkconfig Telnet on
Method Three: Directly modify the configuration file
Vi/etc/xinetd.d/telnet
This is usually 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
}
Just change "disable= yes" to "Disable=no"
Iv. Activation of services
Telnet is hung under the xinetd, so naturally just reactivate xinetd will be able to re-read the xinetd inside the settings, so just set the telnet nature
can be activated as well.
# servicexinetd Restart
or #/etc/rc.d/init.d/xinetd restart.
Five. Iptables firewall will block Telnet, so you need to allow iptables, use the following command
When you start the Telnet service, you can use the NETSTAT–TUNLP command to see the port used by the Telnet service, and you can find 23. Use the following command to turn on 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 firewall
Or a little ruthless!! Shut down the firewall!
Service Iptables Stop
Vi. Possible issues:
Let's look at two types of errors:
The first type:
[[Email protected] ~]# 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
Workaround: The firewall does not allow the Telnet service, the connection is blocked, the default CentOS only allows SSH, so go to its custom options, before Telnet tick!
The second Kind
[[Email protected] 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 one is the/etc/hosts file configuration problem
Workaround: I add two IP address in it, the content is as follows:
[Email protected] ~]$ more/etc/hosts
# don't 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
Description: Because the client's name is not written in the letter, the content format should be 127.0.0.1 Pcname
Summary: Remember to use Telnet 1. Turn on firewall restrictions on Telnet 2./etc/hosts restrictions on clients 3. Note that/etc/hosts.allow and/etc/hosts.deny two files may restrict access
"Original" Installation and configuration of Telnet under CentOS (full version, Centos5.5 Pro test)