Telnet Server under CentOS

Source: Internet
Author: User
Tags telnet program

Telnet Server under CentOS
1. What is Telnet?
From the Niang explanation: The Telnet protocol is a member of the TCP/IP protocol family and is the standard protocol and main way of Internet remote Login service. It provides users with the ability to perform remote host work on the local computer. Use the Telnet program on the end user's computer to connect to the server. End users can enter commands in the Telnet program that run on the server as if they were entered directly on the server's console. The server can be controlled locally. To start a Telnet session, you must enter a user name and password to log on to the server. Telnet is a common way to remotely control a Web server.
What is the use of 2.Telnet?
Simply put: Allow the user to log in to the remote host system. Using an information resource that is not available on the local computer that is owned by the remote computer, if the primary purpose of the remote is to pass files between the local computer and the remote computer, then using FTP is quicker and more efficient.
3. See if the Linux server is installed with Telnet soft armor
Log in to the remote login LINUXT server to see if the Telnet software is installed.
Rpm-qa|grep Telnet
1 is shown below:


By default, CentOS does not install Telnet-related software for us, as shown in the figure.
So we'll start by installing Telnet shortly thereafter. So now that we're going to install Telnet, what are we going to install? Here we need to install three packages, respectively: telnet.x86_64 1:0.17-48.el6/telnet-server.x86_64 1:0.17-48.el6/xinetd.x86_64 2:2.3.14-40.el6, This needs to be based on its own operating system, I installed a 64-bit. Since you need to install the above three packages, then what is the above three bags? I would like to explain here:
telnet.x86_64 1:0.17-48.el6 (telnet client software)
telnet-server.x86_64 1:0.17-48.el6 (telnet Server Software)
Xinetd.x86_64 2:2.3.14-40.el6 (XINETD is a new generation of network Daemon service programs, also known as Super Internet server, often used to manage a variety of lightweight Internet services)
Install Telnet
Yum-y Install xinetd telnet telnet-server
2 is shown below:


To see if the installation was successful
Rpm-qa|grep Telnet
Rpm-qa|grep xinetd
3 is shown below:

XINETD the configuration files for various network services will appear in the/etc/xinetd.d/directory when the installation is complete.
cd/etc/xinetd.d/
ll
4 is shown below:


To run the Telnet server, you need to modify the file named Telnet in the/etc/xinetd.d/directory. Therefore, we modify the Telnet file to change the disable to No.
Vi/etc/xinetd.d/telnet
5 is shown below:


Execute the xinetd command file and view the XINETD process if no error message indicates that it is performing properly
/usr/sbin/xinetd
Ps-eaf|grep xinetd
6 is shown below:

In fact, when we run xinetd, the Telnet service is not running, so let's take a look at:
Ps-eaf|grep Telnet
7 is shown below:


Let's see if the Telnet port is in listening state.
Netstat-anp|grep:23
8 is shown below:

It is shown that port 23rd is already in the listening state and is being monitored by the xinetd process.
Because of the firewall, we need to open port 23rd in the firewall: iptables-i input-p tcp--dport 23-j ACCEPT
Since my firewall here is off state so do not need to do so, depending on the situation, check the firewall running status can use the command: Service iptables status
After doing this, we can test the connection ...
Using the Windows command interface
9 is shown below:


Connect to a Linux server using Telnet
Telnet 192.168.1.114
10 is shown below:

Why do you report that ' Telnet ' is not an internal or external command, or a program or batch file that can be run. "Error because: our own Windows Telnet feature is turned off by default, so we'll turn this feature on. Of course, if your Telnet function is already open, you can ignore this step.
Enter Control Panel from the Start menu
11 is shown below:

Click to enter "Programs"
12 is shown below:

Click "Start or Turn off Windows features" and find the "Telnet client" in the popup dialog box and check it.
13 is shown below:

We connect to the Linux server again
Telnet 192.168.1.114
--Wait a moment to appear the login screen, the identity has been connected successfully, enter a user name and password to log in.
14 is shown below:

It is important to note that when using Telnet to log on to a Linux server remotely, it is best to use a non-root user (ordinary user) to log in, because Red Hat normally recommends users use secure SSH to telnet to the server instead of using Telnet. Because Telnet connects to the server, the password is transmitted in clear text. Therefore, the default root is to not allow Telnet to log on directly to the server. Of course you can do this if you want to log in with the root user.
Use the root user to modify the configuration in the Linux system as follows:
Vi/etc/securetty
Add at the end of the file
pts/0
Pts/1
Pts/2
Pts/3
If you are logged in more users, you may need more pts/**
This adds the effect of allowing root to log on to Linux from pts/0 to PTS/3
15 is shown below:


Once saved, you can log in to telnet with root.
16 is shown below:


Note: Of course this is not recommended, and for security reasons, it is recommended that you log in directly with a non-root user.
Okay, we're still going back to the non-root login, although we're using a non-root login, but we can use the SU command to switch to the root user.
17 is shown below:


The above garbled is the problem of coding, we do not need to consider, we just need to know that this is prompted to enter the password, we enter the root user password.
We look at the Telnet process again
Ps-eaf|grep Telnet
18 is shown below:

Thus, we have a process in Windows remote to Linux, in fact, each client connection needs a server process to handle.
Now, let's look at the configuration of the Telnet server. Since the Telnet process is running under the control of the xinetd process, it is necessary to understand the configuration of xinetd, and the xinetd master configuration file is/etc/xinetd.conf. So let's review and analyze the configuration:
Cat/etc/xinetd.conf
19 is shown below:


If the configuration options and the default configuration of each server are duplicated, then use each of the services to your own configuration!

Telnet Server under CentOS

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.