Let's take a look at the installation and setup of Ubuntu Linux telnet. First we need to load the Telnet service and then set up the relevant parties for root and so on.
In Windows systems, the configuration of Telnet is relatively simple. Then the Telnet settings in Ubuntu Linux are relatively cumbersome. Many friends are not familiar with this installation process. It's all right, let's take a look at the installation settings for Ubuntu Linux telnet.
1. sudo apt-get install xinetd telnetd
2. After the Ubuntu Linux telnet installation, the system will also have corresponding prompts:
sudo vi/etc/inetd.conf and joins the following line
Telnet Stream TCP nowait telnetd/usr/sbin/tcpd/usr/sbin/in.telnetd
3. sudo vi/etc/xinetd.conf and add the following to the next Ubuntu Linux telnet settings:
# Simple configuration file for xinetd
#
# Some defaults, and include/etc/xinetd.d/
Defaults
{
# Please note ' You need a log_type ' line to ' 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. sudo vi/etc/xinetd.d/telnet and add the following:
# 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. Reboot the machine or restart the network service sudo/etc/init.d/xinetd restart
6. Non-root user access can be done remotely using Telnet client.
7. Log in using root:
Mv/etc/securetty/etc/securetty.bak so that root can be logged in. You can also do this:
Modify/etc/pam.d/login this file. Simply comment out the following line.
#auth Required Lib/security/pam_securetty.so
8. The detailed configuration of Ubuntu Linux telnet/etc/xinetd.d/telnet
Edit Recommendation
TCP/IP protocol topics
TCP/IP (transport into the control of the Negotiation/Internet Protocol) is a network communication protocol, which regulates all communication devices on the network, especially a host with ...
Article Summary: Below we will explain the installation and setup of Ubuntu Linux telnet. First we need to load the Telnet service and then set up the relevant parties for root and so on.
Service Telnet
{
Disable =no
Bind =192.168.1.2
Only_from=192.168.1.0/24
#上面这两行说明仅提供内部网段!
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.
#上面三行设置外部较为严格的限制
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 open Telnet to this network segment and 61.xxx.xxx.xxx IP for 192.168.0.0/24, you can add the following lines of 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.Ubuntu Linux Telnet Last setting, add Firewall/etc/hosts.allow (deny) mechanism:
It opens up the 192.168.0.0/24 segment, but if you just want to get the 192.168.0.1~192.168.0.5 in there, you can set it as follows:
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