How the Linux system opens the Telnet port

Source: Internet
Author: User

Windows clients can use Telnet if they connect to a remote Linux server through a CMD window;

The CentOS system default Telnet 23 port is off.


Server local use nmap IP address-p to view the Telnet status is off;

[[email protected] ~]# Nmap 192.168.20.3-p 23

Starting Nmap 5.51 (http://nmap.org) at 2016-03-11 09:04 CST

Nmap Scan Report for 192.168.20.3

Host is up (0.00014s latency).

PORT State SERVICE

23/TCP closed Telnet


The steps to open the Telnet port are as follows:

1, the server installs the Telnet package (Telnet-server packet relies on the XINETD package)

# yum Install Telnet telnet-server-y

2. Modify the Telnet configuration file

# vi/etc/xinetd.d/telnet

Change Disable=yes to No

Service Telnet

{

Flags = Reuse

Socket_type = Stream

wait = no

user = root

Server =/usr/sbin/in.telnetd

Log_on_failure + = USERID

Disable = no

}

Save exit, restart xinted service

[Email protected] ~]#/etc/init.d/xinetd restartstopping xinetd: [OK]starti ng xinetd: [OK]


Scan again to see status changed to open

[[email protected] ~]# Nmap 192.168.20.3-p 23

Starting Nmap 5.51 (http://nmap.org) at 2016-03-11 10:08 CST

Nmap Scan Report for 192.168.20.3

Host is up (0.00051s latency).

PORT State SERVICE

23/tcp Open Telnet


See port 23 for listening.

[Email protected] ~]# NETSTAT-NLT

Active Internet connections (only servers)

Proto recv-q send-q Local address Foreign address state

TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN

TCP 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

TCP 0 0::: $:::* LISTEN

TCP 0 0::: £ º::* LISTEN

TCP 0 0:: 1:25:::* LISTEN


3, iptables add rules allow 23 ports to pass, save the rules, and restart the Iptables service

# iptables-a input-m State--state new-m tcp-p TCP--dport 23-j accept#/etc/init.d/iptables save#/etc/init.d/iptabl Es restart


4. Windows Local open CMD window

Input command:telnet IP address to a remote Linux server

By default, you cannot use Superuser after Telnet connection, if you want to log in with Superuser root, there are 2 ways to do this:

The first kind: # Mv/etc/securetty/etc/securetty.bak so you can log in with root, very not recommended!!!!

The second type: # Vi/etc/securetty

Add to

pts/0

Pts/1

Pts/2

Pts/3

If you are logged in more users, you can add more pts/**

This adds the role of allowing Root to log in from pts/0 to PTS/3;

Compared to other methods on the net to completely remove the authentication method, this method does not destroy the Linux security authentication mechanism, more secure!


It is recommended to use normal user login, su-root to switch, for security purposes, not directly using root login;

If you do not want to use root login, we recommend using the SSH tool;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s2.51cto.com/wyfs02/m00/7d/38/wkiom1bieq6xmeiraagwipriqdi580.jpg "title=" telnet.jpg "alt=" Wkiom1bieq6xmeiraagwipriqdi580.jpg "/>

CentOS Release 6.5 (Final) Kernel 2.6.32-431.el6.i686 on an i686login:user1Password:Last login:fri Mar one 11:35:11 from 1 92.168.20.1[[email protected] ~]$ iduid=500 (user1) gid=502 (user1) groups=502 (user1) context=unconfined_u:unconfined_ R:unconfined_t:s0-s0:c0.c1023[[email protected] ~]$ Whoamiuser1




This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1749980

How the Linux system opens the Telnet port

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.