Telnet is unavailable !!! Tip:-bash: telnet: command not found, telnet-bash
I. Check1. [root @ localhost ~] # Telnet
Bash: telnet: command not found
2. Check whether the Telnet package is installed. The result is as follows:
[Root @ localhost ~] # Rpm-qa telnet *
Telnet-server-0.17-47.el6.i686
3. query the xinetd status again:
[Root @ localhost ~] # Service xinetd status
Xinetd (pid 2967) is running...
4. Run the ntsysv command to enable the Telnet service. You can also view/etc/xinetd. d/telnet file, change "disable = yes" to "disable = no", and restart the service [root @ CentOS5/] # service xinetd restart
In the system service, I also checked that the telnet service and xinetd are both working statuses.
Ii. Install the service
Solution: reinstall the telnet client.
Centos, ubuntu
Yum list telnet * view the installation package related to telnet
Yum install telnet-server install telnet Service
Yum install telnet. * install the telnet Client
Note: before installation, install # yum install xinetd (Be sure to install it under root) Because telnet depends on the xinetd service to start, so install the service first.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 blocks telnet.Therefore, you must allow the following commands in iptables:
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
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.
Linux telnet problem: After telnet to the linux server on another computer, all logon operations are normal, but ifconfig cannot be executed.
Google. You will know .... I just found the answer .. Too lazy to stick ..
I have installed telnet on the linux Virtual Machine. How can I use telnet on the root Login?
-Server because linux does not have this service by default, you must first install the package and then write the configuration file to/etc/xinetd. d/telnet-Because telnet is in the xinetd service.