Telnet cannot be used!!! Tip:-bash:telnet:command not found

Source: Internet
Author: User

I. Inspection1, [[email protected] ~]# telnet
Bash:telnet:command not found 
2, query whether to install the Telnet package, the results are as follows: 
[[email protected] ~]# Rpm-qa telnet* 
telnet-server-0.17-47.el6.i686 
3, also inquires the state of xinetd: 
[[email protected] ~]# Service xinetd Status 
XINETD (PID 2967) is running ... 
4. Use the NTSYSV command to turn on the Telnet service, and also view the/etc/xinetd.d/telnet file, change "Disable = yes" to "Disable = no", and restart the service [[email protected] /] #service xinetd restart 
In the system service, also checked, Telnet service and xinetd are also working status. 
two. Installation Services
Workaround, re-install the Telnet client. 
CentOS, Ubuntu 
Yum list telnet* viewing Telnet-related installation packages 
Yum Install telnet-server telnet Service 
Yum Install telnet.* telnet Client
Note that installing #yum install xinetd (Note under root) is needed before installation because Telnet relies on the xinetd service to start, so install the service first 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 it needs to be allowed in iptables, with 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 type:
[[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

Telnet cannot be used!!! Tip:-bash:telnet:command not found

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.