In Linux, how does one enable the telnet service?

Source: Internet
Author: User

Today, a company employee got a Red Hat Enterprise 5 installation. After the system was installed, it was found that telnet was not available, and ssh was acceptable. It took a long time to get it done. Combined with the previous information on this aspect, refer to the following:

1. Overview
Linux provides services by running daemon on the background.
The daemon is used to open a port and wait for the connection to enter. In C/S mode, if the customer requests a connection, the daemon creates a (fork) sub-process to respond to the connection, and the parent process continues to listen to requests from other services.
However, if every service provided by the system must run a daemon listening for a port connection, it usually means a waste of system resources. To this end, the "extended network daemon" xinetd (xinetd internet daemon) is introduced ). The telnet service is also protected by xinetd.

2. Checks whether the rpm packages of telnet and telnet-server are installed.
OS: RedHat9

[Root @ localhost root] # rpm-qa telnet
Telnet-0.17-25
// Telnet *. rpm is installed by default //
[Root @ localhost root] # rpm-qa telnet-server
Null
// Telnet *. rpm is not installed by default //

3. Install telnet-server
Telnet-server-0.17-25.i386.rpm on 3rd sheets
[Root @ localhost root] # rpm-ivh telnet-server *. i386.rpm-this package depends on the xinet package.

4. Modify the telnet service configuration file
Vi/etc/xinetd. d/telnet
Service telnet
{
Disable = yes
Flags = REUSE
Socket_type = stream
Wait = no
User = root
Server =/usr/sbin/in. telnetd
Log_on_failure + = USERID
}

Add "#" to the front of the disable = yes line, or change it to "disable = no ".
PS:
After telnet-server is installed, files/usr/sbin/in. telnetd are available.

5. Restart the xinetd daemon
Because the telnet service is also protected by xinetd, after the telnet-server is installed, the xinetd must be restarted to start the telnet service.
[Root @ localhost root] # service xinetd restart
Or
[Root @ localhost root] #/etc/init. d/xinetd restart

6. Disable the system firewall. If it cannot be modified, first modify the user Authentication method and try again (setup-> Authentication configuration)
In linux, the default firewall is "high"

CLI:
[Root @ localhost root] # setup
Select: "firewall configuration"
Select security level -- "no firewall"

7. Set the root user to telnet the host (this is not recommended in the production environment)
# Add pts/0 to vi/etc/securetty. To control the number of simultaneous connections to the root user, add the number of pts/x, where x is the number of 0-255. Example:
# Cat/etc/securetty
Console
Vc/1
Vc/2
Vc/3
Vc/4
Vc/5
Tty1
Tty2
Tty3
Tty4
Tty5
Tty6
Pts/0
Pts/1
Pts/2
Pts/3

8. Test
C:> telnet IP Address
Trying...
Connected to IP
Escape character is '^]'.
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel 2.6.18-8. el5 on an i686
Login:

9. Start telnet by default
1 ). Command ntsysv
Find telnet and use the space key to activate the (*) service.
2 ). Command chkconfig
Chkconfig -- add telnet
Chkconfig telnet on
3 ). GUI
Redhat-conhat-config-services
Or
"Main Menu" -- "system settings" -- "Server Settings" -- "service"

PS:
It is not secure because the plaintext transfer password is used during telnet login. We recommend that you use ssh (secure shell) instead!
F-Secure SSH and putty SSH are generally used in windows.

10. Trouble Shooting

(1). Input telnet 192.168.1.18 on my machine (the machine with the Fedora Core 6 System)
Dos prompt:
Unencrypted connection refused. Goodbye.
Lost connection to the host

Solution reference:
"Unencrypted connection refused, Goodbye"
Solution: Because the enabled Telnet server is/etc/xinetd. d/ekrb5-telnet
So modify the ekrb5-telnet project disable = yes. restart the service inetd restart.

(2) When red hat linux enterprise 5 telnet from another machine, the following error occurs:
(Run telnet 10. x)
Getnameinfo: localhost: Success
Temporary failure in name resolution: Illegal seek
The connection to the host is lost.

Add the address of the telnet client in the host file of red hat linux enterprise 5, for example
10.200.1.130 clientmachine, but it cannot be added. The solution is as follows:
The reason is that the user Authentication method of red hat 5 is strict, and the Firewall settings cannot be modified. You only need to remove some options in Authentication configuration.
# Setup
Select Authentication configuration to remove some Authentication methods, and then modify the settings in Firewall configuration.

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.