Detailed process for opening Telnet service on Linux system

  
                  

The configuration steps of the Telnet service are as follows:

First, install the telnet package (usually two)

1, telnet-client (or telnet), this package provides Telnet client program;

2, telnet-server, this package provides telnet server-side program;


Check if these 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 the package is not detected, you need to install it. Red hat linux 9 has the telnet package installed by default. Generally, you only need to install the telnet-server package.

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

2, installation package


[root@wljs root]#rpm –i telnet-server-0.17-25.i386.rpm


Second, start telnet service


1, open the service

Method 1: Use ntsysv, in the window that appears, add telnet front *, then press OK.


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


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

Find disable = yes Change yes to no.

2, activation service

[root@wljs root]# service xinetd restart


Third, test service

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

If the configuration is correct, the system prompts for the username and password of the remote machine

Login:

Password:

< BR> Note: By default only ordinary users are allowed

IV. Setting telnet port

#vi /etc/services

After entering edit mode, look for telnet (vi edit mode input) /telnet)

will find the following:


telnet 23/tcp

telnet 23/udp

Modify 23 to unused The port number (for example, 2000), exit vi, restart the telnet service, and the default port number of telnet is modified.

five, Telnet service restrictions

telnet is transmitted in clear text passwords and data, if you are not satisfied with its default settings, it is necessary to limit its scope of services. Assuming your host's ip is 210.45.160.17, you can set it as follows, ^_^!

#vi /etc/xinetd.d/telnet

service telnet


{

disable = no #activate telnet service, no


bind = 210.45.160.17 #your ip

only_from = 210.45.0.0/16 # Only allow 210.45.0.0 ~ 210.45.255.255 This segment enters

only_from = .edu.cn # Only Education Network can enter!

no_access = 210.45.160.{115,116} #The two ips are not logged in


access_times = 8:00-12:00 20:00-23:59 # Only these two time periods open service

......

}


Telnet root user login

telnet is not very secure. By default, root is not allowed to telnet into a Linux host. To allow the root user to log in, use the following methods:

[root @wljs /root]# vi /etc/pam.d/login

#auth required pam_securetty.so #将 this line Plus a note!

or


[root@wljs root]# mv /etc/securetty /etc/securetty.bak


This way, root can go directly Linux host. However, it is not recommended to do so. You can also switch to the root user after the normal user enters, and have root privileges.

Copyright © Windows knowledge All Rights Reserved