Linux Telnet service installation and configuration

Source: Internet
Author: User

shut down firewall:service Iptabls stop
Chkconfig Iptabls off

1. Install Telnet Service

[[email protected] ~]# rpm-qa |grep telnet//Check if this related package is installed
Telnet-0.17-47.el6.x86_64
Telnet-server-0.17-47.el6.x86_64

If not installed, configure the Yum source to install using the Yum install telnet telnet-server command

2. Turn on Telnet service (because Telnet uses plaintext to transmit messages, security is not good, many Linux servers do not turn on Telnet service by default)
Edit/etc/xinetd.d/telnet
[Email protected] ~]# vi/etc/xinetd.d/telnet
Find Disable = Yes to change Yes to No

3. Start the Telnet service

[[Email protected] ~]# service xinetd start
[[email protected] ~]# chkconfig telnet on//boot start Telnet service
[[email protected] ~]# chkconfig--list telnet//See if the Telnet service is turned on
Telnet on


4. Modify the Telnet service port
#vi/etc/services
Find the following:
Telnet 23/tcp
Telnet 23/UDP
Change the 23 to an unused port number (for example: 4444), exit VI, restart the Telnet service, and the Telnet default port number is modified.

[Email protected] ~]# Netstat-an |grep 4444
TCP 0 0::: 4444:::* LISTEN

5. Test (use telnet command to connect test under Windows cmd window)
C:\users\administrator>telnet 192.168.1.102 4444
Red Hat Enterprise Linux Server release 6.3 (Santiago)
Kernel 2.6.32-279.el6.x86_64 on an x86_64
Login:rusky
Password:
Last login:wed Apr-10:23:14 from 192.168.1.100
[Email protected] ~]$

6. Telnet Root User Login
Telnet due to security issues, the root account is not allowed to telnet into the system by default. You can use the following method to allow the root account to log in to the system using the Telnet command.
[Root @echo/root]# Vi/etc/pam.d/login
#auth Required pam_securetty.so #将这一行加上注释!
Or add something to the/etc/securetty file using the following instructions
echo "pts/0" >>/etc/securetty
echo "PTS/1" >>/etc/securetty

Once added, the root account will be able to log in to the system using Telnet mode.


7, other configuration of Telnet
Service Telnet
{
Disable = no #启用
Flags = Reuse #socket可重用
Socket_type = Stream #连接方式为TCP
wait = no #为每个请求启动一个进程
user = root #启动服务的用户为root
Server =/usr/sbin/in.telnetd #要激活的进程
Log_on_failure + = USERID #登录失败时记录登录用户名
}

If you want to configure the list of clients allowed to log in, join
Only_from = 192.168.0.2 #只允许192.168.0.2 Login
If you want to configure a list of blocked clients, join
No_access = 192.168.0. {2,3,4} #禁止192.168.0.2, 192.168.0.3, 192.168.0.4 Login
If you want to set up an open window, join
Access_times = 9:00-12:00 13:00-17:00 # Only these two hours per day open service (Our office Hours: P)
If you have two IP addresses, one is the IP address of the private network such as 192.168.0.2, one is the IP address of the public network, such as 218.75.74.83, if you want users to login Telnet service only from the private network, then join
bind = 192.168.0.2
instances = UNLIMITED//number of users allowed to log on, can be integer

The specific meanings and syntax of each configuration item can be referenced in the Xined profile property description (man xinetd.conf)

Linux Telnet service installation and configuration

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.