Configure and use telnet in Redhatlinux9

Source: Internet
Author: User
Configure and use telnet in Redhatlinux9-Linux Enterprise Application-Linux server application information. For details, refer to the following section. To configure the Telnet service, follow these steps:

1. Install the telnet package (usually two)

1. telnet-client (or telnet). This package provides the telnet client program;

2. telnet-server. This package provides telnet server programs;

Check whether these software packages are installed before installation. The method is as follows:

[Root @ wljs root] # rpm? Q telnet or [root @ wljs root] # rpm? Q telnet-client

[Root @ wljs root] # rpm? Q telnet-server


If no software package is detected, install it. By default, the telnet software package is installed in red hat linux 9. Generally, you only need to install the telnet-server software package.

1. Get the telnet-server-0.17-25.i386.rpm package from the installation disk of red hat linux 9.

2. install the software package

[Root @ wljs root] # rpm? I telnet-server-0.17-25.i386.rpm



Ii. Start the telnet Service

1. Start the service

Method 1: Use ntsysv to add * Before telnet in the displayed window, and then press OK.

Method 2: edit/etc/xinetd. d/telnet

[Root @ wljs root] # vi/etc/xinetd. d/telnet

Find disable = yes and change yes to no.

2. Activate the service

[Root @ wljs root] # service xinetd restart



Iii. Test services

[Root @ wljs root] # telnet ip (or hostname)



If the configuration is correct, the system prompts you to enter the user name and password of the remote machine.

Login:

Password:



Note: Only common users are allowed by default.

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

V. Telnet service restrictions

Telnet is a plaintext transmission password and data. If you are not satisfied with the default settings, You need 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.

......

}



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





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 service program" 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

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 system firewall
In linux, the default firewall is "high"

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

7. Test
Telnet IP


QUOTE:
Red Hat Linux release 9 (Shrike)
Kernel 2.4.20-8 on an i686
Login:
Yes!

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

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.