Configure the Telnet server in Ubuntu10.10

Source: Internet
Author: User
First describe my system environment: Ubuntu10.10x86Desktop in this system by default only installed telnet (that is, the client) root@www.linuxidc.com :~ # Dpkg-stelnetPackage: telnetStatus: installokinstalled & nb first describe my system environment: Ubuntu 10.10x86 Desktop

By default, only telnet (client) is installed on this system)

 
 
  1. root@www.linuxidc.com:~# dpkg -s telnet 
  2. Package: telnet 
  3. Status: install ok installed 
  4. Priority: standard 
  5. Section: net 
  6. Installed-Size: 188 
  7. Maintainer: Ubuntu Developers   
  8. Architecture: i386 
  9. Source: netkit-telnet 
  10. Version: 0.17-36build1 
  11. Replaces: netstd 
  12. Provides: telnet-client 

Therefore, only telnet commands can be used to log on to the host where the telnet service is enabled. Others cannot use telnet to log on to the host.

1. Now we want to talk about how to allow others to use telnet to log on to the local machine. We need to install two software:

 
 
  1. root@www.linuxidc.com:~# apt-get install telnetd 
  2. root@www.linuxidc.com:~# apt-get install xinetd 

Telnetd is telnet-server, but it cannot be started by itself. You need to manage the daemon software xinetd to take over.

 
 
  1. root@www.linuxidc.com:~# dpkg -s telnetd 
  2. Package: telnetd 
  3. Status: install ok installed 
  4. Priority: optional 
  5. Section: net 
  6. Installed-Size: 152 
  7. Maintainer: Ubuntu Developers   
  8. Architecture: i386 
  9. Source: netkit-telnet 
  10. Version: 0.17-36build1 
  11. Replaces: netstd 
  12. Provides: telnet-server 

2. Start telnetd through xinetd by creating a new telnet file and entering the following content (no security settings)

 
 
  1. Root@www.linuxidc.com :~ # Vi/etc/xinetd. d/telnet
  2. Service telnet
  3. {
  4. Disable=No 
  5. Socket_type=Stream 
  6. Flags=REUSE 
  7. Wait=No 
  8. User=Root 
  9. Server=/Usr/sbin/In. telnetd# Note that in. telnetd is the file generated by telnetd installation.
  10. Log_on_failure + = USERID
  11. }

If you want to modify the default port number for telnet (23), you need to modify the corresponding telnet port in the/etc/services file.

3. Restart the xinetd program.

 
 
  1. root@www.linuxidc.com:/etc/xinetd.d# service xinetd restart 
  2.  * Stopping internet superserver xinetd                                  [ OK ]  
  3.  * Starting internet superserver xinetd                                  [ OK ] 

In this case, you can use the netstat command to check the listening status of port 23.

 
 
  1. root@www.linuxidc.com:~# netstat -tulnp | grep 23 
  2. tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      4176/xinetd  

4. You can confirm that the telnet server has been set up. In this case, you only need to change the computer and then use the telnet ip address to log on. The default setting is that the root user cannot log on via telnet (telnet is transmitted in plain text on the network, and the password can be detected by sniffer). If the security is ensured, you can use the following method to allow the root user to log on:

(1) modify the/etc/securetty file and add the terminal

 
 
  1. root@www.linuxidc.com:~# tail -5 /etc/securetty  
  2. pts/0 
  3. pts/1 
  4. pts/2 
  5. pts/3 
  6. pts/4 

Or you can directly change the name of the securetty file to use root login.

(2) modify the/etc/pam. d/login file and call the securetty verification Annotation

 
 
  1. 12  # Disallows root logins except on tty's listed in /etc/securetty 
  2. 13  # (Replaces the `CONSOLE' setting from login.defs) 
  3. 14  # Note that it is included as a "required" module. root will be 
  4. 15  # prompted for a password on insecure ttys. 
  5. 16  # If you change it to a "requisite" module, make sure this does not leak 
  6. 17  # user name information. 
  7. 18  #auth       required  pam_securetty.so 

In this way, the telnet configuration is basically complete, but we recommend that you use ssh (however, for windows systems, you need to append dedicated software to ssh, which is really amazing!

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.