Start the telnet service on linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. Step 1: Check whether the telnet Client and Server are installed.
[Root @ test root] # rpm-qa | grep telnet can be used to check whether the software is installed normally.
If the Server is not installed, use the following statement:
Yum install telnet-server
Step 2: After the installation is complete, make necessary settings for some parameters of the telnet service that you open.
The predefined/etc/xinetd. d/telnet content is as follows:
[Root @ linux ~] # Vi/etc/xinetd. d/telnetservice telnet
{Flags = REUSE <= additional parameter usage
REUSE socket_type = stream <= use the TCP packet format
Wait = no <= multiple connections can be connected simultaneously.
User = root <= the default user name is
Root server =/usr/sbin/in. telnetd <= This program is used!
Log_on_failure + = USERID <= If a logon error occurs, log the user ID
Disable = yes <= This service is disabled by default!
}
If it is open internally, you can set it to loose. An example is as follows:
Service telnet
{Disable = no <= the default is to start the telnet service.
Bind = 192.168.1.100 <= allow only packets from this adapter
Only_from = 192.168.1.0/24 <= only allow hosts in the CIDR Block 192.168.0.0/24 to connect to the telnet service.
No_access = 192.168.1. {120130} <= do not allow these PCs to log on
Instances = UNLIMITED <= no restrictions on connections allowed at the same time!
Nice = 0 <== high priority
Flags = REUSE <= additional parameters used
Socket_type = stream <= use the connection type commonly used by tcp Packets
Wait = no <= no wait. Multiple connections are allowed at the same time.
User = root <= user identity of the Startup Program
Server =/usr/sbin/in. telnetd <= program started by the Service
Server_args =-a none <= parameters of the above program
Log_on_failure + = USERID <= the content to be recorded during wrong Login
}
If it is external, the settings should be strict, for example:
Service telnet {
Disable = no <= the default is to start the telnet service.
Bind = 140.116.44.125 <= only packets from this adapter are allowed.
Only_from = 140.116.0.0/16 <= only 140.116.0.0 ~ 140.116.255.255 the network segment is wired to use the telnet service.
Only_from + = .edu.tw <= accumulate settings. Connections can only be established in the academic field!
Access_times =--<= service is only available for these two periods of time every day.
Umask = 022 <= default attribute settings when creating an archive
Instances = 10 <== only 10 connections are allowed at the same time
Nice = 10 <== low priority
Flags = REUSE <= additional parameters used
Socket_type = stream <= use the connection type commonly used by tcp Packets
Wait = no <= no wait. Multiple connections are allowed at the same time.
User = root <= user identity of the Startup Program
Server =/usr/sbin/in. telnetd <= program started by the Service
Server_args =-a none <= parameters of the above program
Log_on_failure + = USERID <= the content to be recorded during wrong Login
}
In the above example, we use a lot of network IP display methods, including 192.168.1.0/24 and 140.116.0.0/16, which represent "192.168.1.0 ~ All IP addresses of 192.168.1.255 and "140.116.0.0 ~ 140.116.255.255 all IP addresses 』
Step 3: Start the telnet service # If your telnet has been started, you will find a connection in your system.
[Root @ linux ~] # Netstat-tulnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0 0.0.0.0: 23 0.0.0.0: * LISTEN 19255/xinetd
# See! It's the xinetd's program name!
# Restart/etc/xinetd. d/telnet and observe the following methods:
[Root @ linux ~] #/Etc/init. d/xinetd restart
[Root @ linux ~] # Netstat-tulnpActive Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0 140.116.44.125: 23 0.0.0.0: * LISTEN 19281/xinetd
Tcp 0 0 192.168.1.100: 23 0.0.0.0: * LISTEN 19281/xinetd
# Have you seen two interfaces? Besides, the PID will be the same!
Step 4: telnet to log on to the Local Machine
Because the root user is not allowed to log on via telnet by default, you need to create another account in advance, such as root1.
[Root @ test root] # telnet localhost
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Red Hat Linux release 7.2 (Enigma)
Kernel 2.4.18 on an i586
Login: root1 <= enter the account
Password: <= enter the Password! The password does not display any words on the screen.
Last login: Thu Oct 3 11:59:29 from test_inside <= prompt the Last login address
You have new mail. <= whether there are new emails in the mailbox since the last login!
[Test @ test] $ <== the online telnet program is displayed!
[Test @ test] $ exit <= exit the telnet logon!
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