Install and configure telnet in ubuntu

Source: Internet
Author: User
Tags syslog

Install and configure telnet in ubuntu 1. after sudo apt-get install xinetd telnetd2. 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. telnetd3. sudo vi/etc/xinetd. conf and add the following content: # Simple configuration file for xinetd # Some ults, and include/etc/xinetd. d/defaults {# Please note that you need a log_type line to be able to use log_on_success # and log_on_failure. The default is the following: # log_type = SYSLOG daemon info instances = 60 log_type = SYSLOG authpriv log_on_success = host pid log_on_failure = HOST cps = 25 30} includedir/etc/xinetd. d4. sudo vi/etc/xinetd. d/telnet and add The following content: # 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} 5. restart the machine or restart the network service sudo/etc/init. d/xinetd restart6. use the TELNET client to remotely log on to non-root users. 7. log on to mv/etc/securetty. bak as root. You can also modify the/etc/pam. d/login file. Just comment out the following line. # Auth required lib/security/pam_securetty.so 8. specific configuration:/etc/xinetd. d/telnet service telnet {disable = no bind = 192.168.1.2 only_from = 192.168.1.0/24 # the above two lines show that only the Intranet segment is provided! Instance = UNLIMITED Nice = 0 Flags = REUSE socket_type = stream wait = no user = root # server =/usr/sbin/telnetd server =/usr/sbin/in. telnetd server_args =-a none log_on_failure = USERID} service telnet {disable = no bind = 140.116.142.196 only_from = 140.116.0.0/16 no_access = 140.116.32. {} # the above three rows set more strict external restrictions instance = 10 umask = 022 nice = 10 flags = REUSE socket_type = stream wait = no user = root # server =/u Sr/sbin/telnetd server =/usr/sbin/in. telnetd log_on_failure = USERID} 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 DROP10. add firewall/etc/hosts. allow (deny) mechanism: above The CIDR Block 192.168.0.0/24 is opened, 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.