How to open telnet function in Linux?

  
                  

First, install the Telnet software package (usually two)

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

2 Telnet-server, this package provides the Telnet server-side program;

Check if these packages are installed before installation, as follows:

[root@echo root]#rpm – q Telnet

[root@wljs root]#rpm –q Telnet-client

[root@echo root]#rpm –q Telnet-server

If not detected The package needs to be installed. Red hat Linux 9 has the Telnet package installed by default. Generally, you only need to install the Telnet-server package.

1. Obtain the Telnet-server-0.17-25.i386.rpm package in the red hat Linux 9 installation disk 3.

2, installation package

[root@echo root]#rpm –i Telnet-server-0.17-25.i386.rpm

Second, start Telnet service < Br>

1, open the service

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

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

[root@echo root]# vi /etc/xinetd.d/Telnet

Find disable = yes Change yes to no.

2, activation service

[root@echo root]# service xinetd restart

Three, test service

[root@echo root]#Telnet Ip (or hostname)

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

Login:

PassWord:

Note: The default is only Allow ordinary users

4. Set Telnet port

#vi /etc/services

Find Telnet after entering edit mode (input/Telnet in vi edit mode)

will find the following:

Telnet 23/tcp

Telnet 23/udp

Modify 23 to an unused port number (eg 2000), exit Vi, restart the Telnet service, the default port number of Telnet is modified.

V. Telnet Service Restrictions

Telnet is a clear text transfer password and data. If you are not satisfied with its default settings, it is necessary to limit its service scope. 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 network segment enters

only_from = .edu.cn # Only the education network can enter!

no_access = 210.45.160. #The two ips cannot be logged in

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

......

}

Six, Telnet root user login

Telnet is not very secure, By default, root is not allowed to telnet into Linux/"target=_blank>Linux host. To allow root user login, use the following method:

[root @echo /root]# vi /etc/Pam.d/login

#auth required pam_securetty.so #Comment this line!

or

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

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

Note: I don't need to install the Telnet server in my FC4, because I already have krb5-Telnet. Step

vi /etc/xinetd.d/krb5-Telnet is OK.

Copyright © Windows knowledge All Rights Reserved