Ubuntu telnet settings

Source: Internet
Author: User

Linux has a huge role in many enterprises. Many administrators also hope that the Linux system can contain more functions. Here we will introduce the settings and operations related to Ubuntu telnet.

1. sudo apt-get install xinetd telnetd

2. after Ubuntu telnet is successfully installed, the system prompts sudo vi/etc/inetd. conf and add the following line to telnet stream tcp nowait telnetd/usr/sbin/tcpd/usr/sbin/in. telnetd

3. Add the following content to sudo vi/etc/xinetd. conf:

 
 
  1. # Simple configuration file for xinetd # # Some defaults, and include /etc/xinetd.d/ defaults   
  2. {   
  3. # Please note that you need a log_type line to be able to use log_on_success  
  4. # and log_on_failure. The default is the following :   
  5. # log_type = SYSLOG daemon info instances = 60 log_type = SYSLOG authpriv log_on_success = HOST PID log_on_failure = HOST cps = 25 30   
  6. }  
  7.  includedir /etc/xinetd.d 

4. Add the following content to sudo vi/etc/xinetd. d/telnet:

 
 
  1. # default: on   
  2. # description: The telnet server serves telnet sessions; it uses \  
  3. # unencrypted username/password pairs for authentication. service telnet   
  4. {   
  5. disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID  

5. restart the machine or restart the Ubuntu telnet network service sudo/etc/init. d/xinetd restart

6. Use the TELNET client to remotely log on to non-root users.

7. use root to log on to mv/etc/securetty. in this way, the root user can log on to the bak. you can also modify/etc/pam. d/login. just comment out the following line. # auth required lib/security/pam_securetty.so

8. Detailed configuration of Ubuntu telnet

 
 
  1. /Etc/xinetd. d/telnet service telnet
  2. {
  3. Disable = no bind = 192.168.1.2 only_from = 192.168.1.0/24 # the above two lines describe that only Intranet segments are provided!
  4. Instance = UNLIMITED Nice = 0 Flags = REUSE socket_type = stream wait = no user = root
  5. # Server =/usr/sbin/telnetd server =/usr/sbin/in. telnetd server_args =-a none log_on_failure + = USERID
  6. } Service telnet
  7. {
  8. Disable = no bind = 140.116.142.196 only_from = 140.116.0.0/16 no_access = 140.116.32. {10, 26}
  9. # The above three rows set stricter external restrictions instance = 10 umask = 022 nice = 10 flags = REUSE socket_type = stream wait = no user = root
  10. # Server =/usr/sbin/telnetd server =/usr/sbin/in. telnetd log_on_failure + = USERID
  11. }

9. add firewall iptables: If you want to address the network segment 192.168.0.0/24 and 61. xxx. xxx. the IP address xxx is available for telnet. You can add the following rules: /sbin/iptables-a input-p tcp-I eth0-s 192.168.0.0/24 -- dport 23-j ACCEPT/sbin/iptables-a input-p tcp-I eth0-s 61. xxx. xxx. xxx -- dport 23-j ACCEPT/sbin/iptables-a input-p tcp-I eth0 -- dport 23-j DROP

10. Add the Firewall/etc/hosts. allow (deny) mechanism: the IP address range 192.168.0.0/24 is enabled, but if you only want ~ Enter 192.168.0.5. You can set vi/etc/hosts. allow in. telnetd: 192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4, 192.168.0.5: allow

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.