RedHat enable the Telnet Service

Source: Internet
Author: User

1. Use the RPM command to check whether the RPM package of telnet-server is installed.

[Root @ localhost root] # rpm-Qa Telnet
Telnet-0.17-25
Telnet *. rpm is installed by default.
[Root @ localhost root] # rpm-Qa telnet-Server
The display is blank. Telnet *. rpm is not installed by default.

2. Install telnet-Server
The required files are stored in the 3rd CdS/RedHat/RPMS directory named telnet-server-0.17-25.i386.rpm

[Root @ localhost root] # Mount/mnt/CDROM
[Root @ localhost root] # cd/mnt/CDROM // RedHat/RPMS
[Root @ localhost root] # rpm-IVH telnet-server-0.17-25.i386.rpm

PS: attach the CD first, and then install

3. modify the content of the Telnet service configuration file
[Root @ localhost root] # vi/etc/xinetd. d/telnet

Service telnet
{
Flags = Reuse
Socket_type = stream
Wait = No
User = root
Server =/usr/sbin/in. telnetd
Log_on_failure + = userid
Disable = Yes
}

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.

4. 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

5. disable the system firewall

In Linux, the default firewall is "high"

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

6. Test

Connect to the redhat9 machine with the telnet service installed on another machine
Telnet IP

Appears
Red Hat Linux release 9 (Shrike)
Kernel 2.4.20-8 on an i686
Login:
The above content indicates that the connection is OK.
PS: at this time, you cannot directly use the root user for remote login. you can log on with another user, and then use the su command to switch.

7. Start Telnet by default

1. Command ntsysv
[Root @ localhost root] # ntsysv
Find Telnet and use the space key to activate the (*) Telnet service.
2. Command chkconfig
[Root @ localhost root] # chkconfig -- add Telnet
[Root @ localhost root] # chkconfig telnet on
3. graphical user interface GUI
1). [root @ localhost root] # RedHat-config-services
2). Or click "Main Menu"/"system settings"/"Server Settings"/"services"

8. Set the telnet port # vi/etc/services
Go to edit mode and find telnet (input/telnet in VI editing mode)
The following content is found:
Telnet 23/tcp
Telnet 23/udp
Modify 23 to an unused port number (for example, 2000), exit VI, restart the telnet service, and modify the default port number for telnet.

9. the telnet service restricts the use of passwords and data transmitted in plain text. If you are not satisfied with the default settings, it is necessary to restrict the service scope. Suppose your host's IP address is 210.45.160.17, you can set it as follows, ^_^!
# Vi/etc/xinetd. d/telnet
Service telnet
{
Disable = No # activate the telnet service, no
Bind = 210.45.160.17 # Your IP
Only_from = 210.45.0.0/16 # Only 210.45.0.0 ~ is allowed ~ 210.45.255.255
Only_from = .edu.cn # Only CERNET can access!
No_access = 210.45.160. {115,116} # these two IP addresses cannot be logged on
Access_times =--# The service is only available for these two periods of time every day.
......
}

10. login from telnet Root User
Telnet is not safe. By default, the root user is not allowed to use Telnet to access the Linux host. To allow the root user to log on, use the following methods:
[Root @ wljs/root] # vi/etc/PAM. d/login
# Auth required pam_securetty.so # Add comments to this line!
Or
[Root @ wljs root] # mv/etc/securetty. Bak
In this way, the root user can directly access the Linux host. However, we recommend that you do not do this. You can also switch to the root user after a common user enters, with the root permission.

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.