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:
- # Simple configuration file for xinetd # # Some defaults, 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.d
4. Add the following content to sudo vi/etc/xinetd. d/telnet:
- # 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 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
- /Etc/xinetd. d/telnet service telnet
- {
- 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!
- 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. {10, 26}
- # The above three rows set stricter external restrictions instance = 10 umask = 022 nice = 10 flags = REUSE socket_type = stream wait = no user = root
- # Server =/usr/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 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