Telnet can not use prompt: -bash: telnet: command not found

1. Check
1. [ 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. Check the status of xinetd: [ root@localhost ~]# service xinetd status xinetd (pid 2967) is running... 4. Use the ntsysv command to enable the Telnet service; at the same time, check /etc/xinetd .d/telnet file, change "disable = yes" to "disable = no"; also restarted the service [ root@CentOS5 /]#service xinetd restart In the system service, I have also checked, the telnet service and xinetd are also is working state. 2. Install the service The solution is to reinstall the telnet client. centos, ubuntu yum list telnet* View telnet related installation packages  
 
   
 
 
   
 
   
 

 
 
 
yum install telnet-server install telnet service yum install telnet.* install telnet client  
 
Note that #yum install xinetd must be installed before installation (note that it is installed under root) because telnet depends on the xinetd service to start, so the service must be installed first
3. Configure telnet 
Method 1: Use ntsysv, in the window that appears, check telnet, and then press OK! Method 2: Use the chkconfig command to directly enable #chkconfig telnet on Method 3: Modify the configuration file directly vi /etc/xinetd.d/telnet is generally like this: # 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 need to set "disable= yes" Change to "disable=no" Fourth, activate the service  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Telnet hangs under xinetd, so naturally, as long as xinetd is reactivated, the settings in xinetd can be read again, so the telnet that .   # servicexinetd restart or #/etc/rc.d/init.d/xinetd restart 5. The iptables firewall will block telnet , so you need to allow it in iptables, use the following command After you start the telnet service, you can use the netstat –tunlp command to Looking at the port used by the telnet service, it can be found that there is 23. Use the following commands to open 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 be more aggressive of! ! Turn off the firewall!  Service iptables stop  Six, possible problems:  Let's take a look at two kinds of errors: the 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: The firewall does not allow telnet service, the connection is blocked, the default CentOS only allows SSH, so enter its Custom options, put a tick in front of telnet! The 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 one is the solution to the /etc/hosts file configuration problem  : I add two IP addresses in it, as follows: [ linux@localhost ~]$ more /etc/hosts  # Do not remove the following line, or various programs  
 


   
 
 
 
 
 
 

 
 
 
# that require network functionality will fail. 127.0.0.1localhost.localdomainlocalhost ::1localhost6.localdomain6localhost6 192.168.1.88 192.168.1.86 Description: Because the name of the client is not easy to remember, it is not written in, and the content format should be 127.0.0.1 pcname  
 
 
 
 
 
http://www.filewatcher.com/m/telnet-0.17-47.el6_3.1.x86_64.rpm.58196-0.html
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326127758&siteId=291194637