1. view the linux version: [loong @ localhost ~] $ Cat/etc/issueCentOSrelease5.8 (Final) Kernel \ ronan \ m2. check whether telnet-server is installed in the system. telnet-client (or telnet) is installed in the linux system by default ), telnet-server must be manually installed. [Loong @ localhost
1. view the linux version information:
[loong@localhost ~]$ cat /etc/issueCentOS release 5.8 (Final)Kernel \r on an \m
2. check whether telnet-server is installed in the system. telnet-client (or telnet) is installed in linux by default, while telnet-server must be installed manually.
[loong@localhost ~]$ rpm -qa | grep telnettelnet-0.17-39.el5
3. install telnet-server. skip this step if the system is already installed.
Method 1: Download RPM resource telnet-server,: http://rpmfind.net/linux/rpm2html/search.php? Query = telnet-server
Select the corresponding version of telnet-server to download;
Installation: # rpm-I telnet-server-0.17-39.el5.i386.rpm # seems to have to install xinetd separately.
Method 2: (recommended)
# Yum install telnet-server
After installation:
[loong@localhost ~]$ rpm -qa | grep telnettelnet-0.17-39.el5telnet-server-0.17-39.el5
4. start the telnet service.
Method 1: System-> Administration-> Services,
Select telnet in On Demand Services,
Select xinetd in Background Services, and click Start above, which is displayed on the right: xinetd (pid 15986) is running...
Save & Quit.
Method 2: edit/etc/xinetd. d/telnet and change disable = yes to no.
After modification:
# default: on# description: The telnet server serves telnet sessions; it uses \# unencrypted username/password pairs for authentication.service telnet{ disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID}
Method 3: Use the chkconfig command to directly enable
[root@localhost loong]# chkconfig telnet on
Note: Method 2 and method 3 require the xinetd service to be activated. The method is as follows:
[root@localhost loong]# service xinetd restartStopping xinetd: [ OK ]Starting xinetd: [ OK ]
Or:
[root@localhost loong]# /etc/rc.d/init.d/xinetd restartStopping xinetd: [ OK ]Starting xinetd: [ OK ]
5. test services
[root@localhost loong]# telnet localhostTrying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.CentOS release 5.8 (Final)Kernel 2.6.18-308.1.1.el5 on an i686login: loongPassword: Last login: Tue Apr 24 16:42:06 from 10.108.14.135[loong@localhost ~]$ exitlogoutConnection closed by foreign host.[root@localhost loong]#
telnet> o localhostTrying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.CentOS release 5.8 (Final)Kernel 2.6.18-308.1.1.el5 on an i686login: rootPassword: Login incorrectlogin: Login incorrectlogin: Login incorrectlogin: Connection closed by foreign host.[root@localhost loong]# tail -20 /var/log/secureApr 24 17:32:58 localhost login: pam_securetty(remote:auth): access denied: tty 'pts/1' is not secure !Apr 24 17:33:03 localhost login: FAILED LOGIN 1 FROM localhost FOR root, Authentication failure
You can see access denied: tty 'PTS/1' is not secure!
Therefore, add 'PTS/1' to/etc/securetty to enable logon as the root user of telnet. Why? It is unclear.
Method 2: modify/etc/pam. d/remote and comment out auth required pam_securetty.so.
1 #%PAM-1.02#auth required pam_securetty.so3 auth include system-auth
Note: it is not recommended to enable telnet root logon, which may cause security risks.