1. sudo apt-get install xinetd telnetd
2. sudo vim/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 the 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 #表示使syslog for service registration
log_on_success = HOST PID #表示设置成功后记录客户机的IP地址进程的ID
Log_on_failure = HOST #表示设置失败后记录客户机的IP地址
CPS = #表示每秒25个入站连接, wait 30 seconds for the user to deal with denial of service attacks
}
Includedir/etc/xinetd.d #表示告诉xinetd要包含的文件或目录是/etc/xinetd.d.
3. 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 #表示服务的数据包类型为stream.
wait = no #表示不需等待, that is, the service will run in a multithreaded manner.
user = root #表示执行此服务进程的用户是root.
Server =/usr/sbin/in.telnetd #启动脚本的位置.
Log_on_failure + = USERID #表示设置失败时, the UID is added to the system registration form.
}
4. Restart the machine or restart the network service sudo/etc/init.d/xinetd restart
5. Remote login with Telnet Client for non-root user access.
6. Log in with Root:
Mv/etc/securetty/etc/securetty.bak So root can log in. This is also true:
Modify/etc/pam.d/login this file. Just comment out the following line.
#auth Required Lib/security/pam_securetty.so
7. Detailed configuration of Ubuntu Linux telnet/etc/xinetd.d/telnet
Editorial recommendations
TCP/IP protocol topics
TCP/IP (transfer into control/Internet Protocol) is a network communication protocol that regulates all communication devices on the network, especially one host and the other.
Article Summary: 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 it up for the other parties like root.
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 telnet to this network segment and 61.xxx.xxx.xxx this IP, you can add the following lines of rules: 192.168.0.0/24
/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, with a firewall/etc/hosts.allow (deny) mechanism:
It opens the 192.168.0.0/24, but if you just want to get the 192.168.0.1~192.168.0.5 into it, you can set it up 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