当前位置:网站首页>[telnet] telnet installation and configuration

[telnet] telnet installation and configuration

2022-06-21 07:24:00 Dabao

One 、 Reference link

Alibaba open source mirror site -OPSX Mirror station - Alicloud developer community

telnet-server-0.17-66.el7.x86_64.rpm

telnet-0.17-66.el7.x86_64.rpm

Two 、Telnet Introduce

Telnet It's an application layer protocol , Used in Internet and lan , Form of using virtual terminal , Provide two-way 、 Interactive function of command line interface based on text string . Belong to TCP/IP One of the protocol families , It is the standard protocol and main way of Internet remote login service , Commonly used for remote control of servers , Allows the user to perform work on the remote host on the local host .

3、 ... and 、Telnet Installation and configuration

<font color=red> This experiment is based on CentOS 7.9 Demonstrate the operation of the system .</font>

[[email protected] ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

1 、 Inquire about telnet Whether the relevant service components have been installed

Inquire about telnet-server、telnet-client、xinetd Whether the service components are installed .

The inquiry found that ,xinetd、telnet and telnet-server Not installed .

[[email protected] ~]# rpm -qa | grep telnet
[[email protected] ~]# rpm -qa | grep xinetd
[[email protected] ~]# yum list | grep telnet
telnet.x86_64                1:0.17-66.el7              updates  
telnet-server.x86_64         1:0.17-66.el7              updates  
[[email protected] ~]# yum list | grep xinetd
xinetd.x86_64                               2:2.3.15-14.el7            base   
xinetd yes Linux The system's super daemon , Long term resident in the background , And listen for requests from the network , To start the corresponding service . and telnet It is xinetd One of the services under jurisdiction .

2、 Inquire about YUM Whether the source provides telnet Related components

Take a look at the configured YUM Whether the source provides telnet Related installation package

<font color=red>yum provides telnet telnet-server xinetd</font>

[[email protected] ~]# yum list | grep telnet && yum list | grep xinetd
telnet.x86_64               1:0.17-66.el7              updates  
telnet-server.x86_64        1:0.17-66.el7              updates  
xinetd.x86_64               2:2.3.15-14.el7            base     
[[email protected] ~]# 

3、 install telnet Related service components

contain telnet、telnet-server、xinetd Service components

<font color=red>yum install -y xinetd telnet telnet-server</font>

#  Execute this command to install 
yum install -y xinetd telnet telnet-server

image-20220222113450796

4、 Check whether the installation is complete

<font color=red> yum list | grep telnet && yum list | grep xinetd</font>
#  Execute this command to query , belt @ The symbol indicates that... Is installed .
[[email protected] ~]# yum list | grep telnet && yum list | grep xinetd
telnet.x86_64             1:0.17-66.el7              @updates 
telnet-server.x86_64      1:0.17-66.el7              @updates 
xinetd.x86_64             2:2.3.15-14.el7            @base    
#  Reference link :https://www.cnblogs.com/gengbo/p/15913541.html
#  Query all installed software information 
[[email protected] ~]# rpm -qa telnet telnet-server xinetd
xinetd-2.3.15-14.el7.x86_64
telnet-server-0.17-66.el7.x86_64
telnet-0.17-66.el7.x86_64

#  Show details 
[[email protected] ~]# rpm -qi telnet-server
Name        : telnet-server
Epoch       : 1
Version     : 0.17
Release     : 66.el7
Architecture: x86_64
Install Date: Tue 22 Feb 2022 11:34:33 AM CST
Group       : System Environment/Daemons
Size        : 56361
License     : BSD
Signature   : RSA/SHA256, Wed 18 Nov 2020 10:20:43 PM CST, Key ID 24c6a8a7f4a80eb5
Source RPM  : telnet-0.17-66.el7.src.rpm
Build Date  : Tue 17 Nov 2020 12:44:28 AM CST
Build Host  : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://web.archive.org/web/20070819111735/www.hcs.harvard.edu/~dholland/computers/old-netkit.html
Summary     : The server program for the Telnet remote login protocol
Description :
Telnet is a popular protocol for logging into remote systems over the
Internet. The package includes a daemon that supports Telnet remote
logins into the host machine. The daemon is disabled by default.
You may enable the daemon by editing /etc/xinetd.d/telnet


#  Show a list of all files 
[[email protected] ~]# rpm -ql telnet telnet-server xinetd
/usr/bin/telnet
/usr/share/doc/telnet-0.17
/usr/share/doc/telnet-0.17/README
/usr/share/man/man1/telnet.1.gz
/usr/lib/systemd/system/telnet.socket
/usr/lib/systemd/system/[email protected]
/usr/sbin/in.telnetd
/usr/share/man/man5/issue.net.5.gz
/usr/share/man/man8/in.telnetd.8.gz
/usr/share/man/man8/telnetd.8.gz
/etc/sysconfig/xinetd
/etc/xinetd.conf
/etc/xinetd.d/chargen-dgram
/etc/xinetd.d/chargen-stream
/etc/xinetd.d/daytime-dgram
/etc/xinetd.d/daytime-stream
/etc/xinetd.d/discard-dgram
/etc/xinetd.d/discard-stream
/etc/xinetd.d/echo-dgram
/etc/xinetd.d/echo-stream
/etc/xinetd.d/tcpmux-server
/etc/xinetd.d/time-dgram
/etc/xinetd.d/time-stream
/usr/lib/systemd/system/xinetd.service
/usr/sbin/xinetd
/usr/share/doc/xinetd-2.3.15
/usr/share/doc/xinetd-2.3.15/CHANGELOG
/usr/share/doc/xinetd-2.3.15/COPYRIGHT
/usr/share/doc/xinetd-2.3.15/README
/usr/share/doc/xinetd-2.3.15/empty.conf
/usr/share/doc/xinetd-2.3.15/sample.conf
/usr/share/man/man5/xinetd.conf.5.gz
/usr/share/man/man5/xinetd.log.5.gz
/usr/share/man/man8/xinetd.8.gz

5、 start-up telnet Related services

Carry out orders , Opening service , And set the power on self starting .
systemctl start telnet.socket xinetd
systemctl enable telnet.socket xinetd
systemctl status telnet.socket xinetd

6、 Check the service listening port

[[email protected] ~]# netstat -tnl |grep 23 
tcp6       0      0 :::23        :::*                    LISTEN     
[[email protected] ~]# ss -tunpl | grep 23
tcp    LISTEN     0      128    [::]:23   [::]:*          users:(("systemd",pid=1,fd=33))
[[email protected] ~]# 

Four 、Telnet Remote connection test

1、 Create user xybdiy

[[email protected] ~]# useradd xybdiy
[[email protected] ~]# passwd xybdiy
Changing password for user xybdiy.
New password: 
BAD PASSWORD: The password is a palindrome
Retype new password: 
passwd: all authentication tokens updated successfully.

2、 Use xybdiy user telnet Sign in

telnet 192.168.200.11

Kernel 3.10.0-1160.53.1.el7.x86_64 on an x86_64
master login: xybdiy
Password:
[[email protected] ~]$ su -
Password:
Last login: Tue Feb 22 12:39:35 CST 2022 on pts/1
Last failed login: Tue Feb 22 12:52:02 CST 2022 on pts/2
There was 1 failed login attempt since the last successful login.
[[email protected] ~]#

3、 Set allowed ROOT user Telnet Sign in

Reference link telnet allow root The user login - Strict specifications - Kung Fu is home - Blog Garden

1️⃣#  modify login file 
 vim /etc/pam.d/login
  Comment on this line of file 
 #account    required     pam_nologin.so
 Press :wq Save and exit .

2️⃣#  Comment out securetty file 
mv /etc/securetty /etc/securetty.bak
C:\Users\xybdiy>telnet 192.168.200.11

Kernel 3.10.0-1160.53.1.el7.x86_64 on an x86_64
master login: root
Password:
Last failed login: Tue Feb 22 13:59:24 CST 2022 from ::ffff:192.168.200.2 on pts/1
There was 1 failed login attempt since the last successful login.
Last login: Tue Feb 22 13:45:55 on pts/2
[[email protected] ~]#
[[email protected] ~]# telnet localhost
Trying ::1...
Connected to localhost.
Escape character is '^]'.

Kernel 3.10.0-1160.53.1.el7.x86_64 on an x86_64
master login: root
Password: 
Last login: Tue Feb 22 14:11:49 from ::ffff:192.168.200.2
[[email protected] ~]# 
原网站

版权声明
本文为[Dabao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221514438562.html