linux安装删除telnet服务端和客户端

安装telnet软件包
telnet-client (或 telnet),这个软件包提供的是 telnet 客户端程序;
telnet-server 软件包,这个才是真正的 Telnet server 软件包。

1、先检测是否这些软件包已经安装
[[email protected] xinetd.d]# rpm -qa | grep telnet
telnet-server-0.17-64.el7.x86_64
telnet-0.17-64.el7.x86_64

2、telnet-server服务启动依赖xinetd服务,
需要首先安装,如果telnet-server服务在xinetd之前安装了,要先删除telnet-server,再安装xinetd
1)查看是否安装
rpm -qa | grep xinetd
2)安装xinetd服务
[[email protected] xinetd.d]# yum -y install xinetd

3、安装或卸载软件包
根据上面的命令获取已安装软件包名称
卸载:
[[email protected] xinetd.d]# rpm -e telnet-server-0.17-64.el7.x86_64
[[email protected] xinetd.d]# rpm -e telnet-0.17-64.el7.x86_64

安装:
安装客户端:yum -y install telnet
1)使用yum list |grep telnet命令获取查找telnet-server的源文件:
[[email protected] /]# yum list |grep telnet
telnet.x86_64 1:0.17-64.el7 @base
telnet-server.x86_64 1:0.17-64.el7 @base
dcap-tunnel-telnet.x86_64 2.47.11-1.el7 epel

2)安装服务端
yum install telnet-server.x86_64

4、查看是否安装成功
[[email protected] /]# rpm -qa | grep telnet
telnet-server-0.17-64.el7.x86_64
telnet-0.17-64.el7.x86_64

5、开启服务
telnet服务之后,默认是不开启服务,修改文件/etc/xinetd.d/telnet来开启服务。
注:如有则修改,第一次修改,此文件若不存在,可自己vim创建。修改 disable = yes 为 disable = no
修改后的telnet文件为:
# default: yes
# description: The telnet server servestelnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server =/usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}

6、安装后检查
[[email protected] xinetd.d]# rpm -qa | grep xinetd
xinetd-2.3.15-13.el7.x86_64
[[email protected] xinetd.d]# rpm -qa | grep telnet
telnet-0.17-64.el7.x86_64
telnet-server-0.17-64.el7.x86_64

7、启动telnet和依赖的xinetd服务
在centos7之前:
service xinetd restart 或 /etc/rc.d/init.d/xinetd restart

在centos7中:
无xinetd的service启动项
[[email protected] xinetd.d]# service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service
[[email protected] xinetd.d]# systemctl restart xinetd.service
[[email protected] xinetd.d]#

8、查看启动
[[email protected] xinetd.d]# ps -ef|grep xinetd
root 14910 1 0 10:01 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root 14919 14291 0 10:03 pts/0 00:00:00 grep --color=auto xinetd

9、测试telnet
[[email protected] xinetd.d]# telnet 120.78.144.82
Trying 120.78.144.82...
Connected to 120.78.144.82.
Escape character is ‘^]‘.

Kernel 3.10.0-693.2.2.el7.x86_64 on an x86_64
iZwz95a6wosz6klzf7o6hcZ login: root
Password:

10、设置服务开机启动
[[email protected] xinetd.d]# chkconfig --level 35 xinetd on
Note: Forwarding request to ‘systemctl enable xinetd.service‘.
[[email protected] xinetd.d]# systemctl enable xinetd.service
[[email protected] xinetd.d]#

11、查看启动项
[[email protected] xinetd.d]# chkconfig --list

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

If you want to list systemd services use ‘systemctl list-unit-files‘.
To see services enabled on particular target use
‘systemctl list-dependencies [target]‘.

aegis 0:off 1:off 2:on 3:on 4:on 5:on 6:off
agentwatch 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off

xinetd based services:
chargen-dgram: off
chargen-stream: off
daytime-dgram: off
daytime-stream: off
discard-dgram: off
discard-stream: off
echo-dgram: off
echo-stream: off
tcpmux-server: off
telnet: on
time-dgram: off
time-stream: off

问题1:总是提示Login incorrect

Kernel 3.10.0-693.2.2.el7.x86_64 on an x86_64
iZwz95a6wosz6klzf7o6hcZ login: root
Password:
Login incorrect
解决办法:
注释/etc/pam.d/remote的第一行,即:auth required pam_securetty.so
---------------------
[[email protected] pam.d]# cat remote
#%PAM-1.0
#auth required pam_securetty.so
auth substack password-auth
auth include postlogin
account required pam_nologin.so
account include password-auth
password include password-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include password-auth
session include postlogin
---------------------------------------------------

问题2:登录不成功,防火墙设置

其他机器远程telnet的时候,登陆不成功,可能是防火墙的问题,修改防火墙的设置:
------------------------------------------------------------------------
[[email protected] ~]# netstat -tunlp
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:80 0.0.0.0:* LISTEN 21434/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1169/sshd
tcp 0 0 127.0.0.1:8005 0.0.0.0:* LISTEN 21434/java
tcp 0 0 0.0.0.0:8009 0.0.0.0:* LISTEN 21434/java
tcp6 0 0 :::23 :::* LISTEN 14910/xinetd
tcp6 0 0 :::3306 :::* LISTEN 27713/mysqld
udp 0 0 0.0.0.0:68 0.0.0.0:* 760/dhclient
udp 0 0 172.18.222.199:123 0.0.0.0:* 859/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 859/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 859/ntpd
udp 0 0 0.0.0.0:2221 0.0.0.0:* 760/dhclient
udp6 0 0 :::123 :::* 859/ntpd
udp6 0 0 :::52914 :::* 760/dhclient
------------------------------------------------
再使用iptables修改设置,使用service iptables save保存设置,然后service iptables restart重启防火墙:
[[email protected] ~]# iptables -I INPUT -p tcp --dport 23 -jACCEPT
[[email protected] ~]# iptables -I INPUT -p udp --dport 23 -jACCEPT
[[email protected] ~]# service iptables save --可能会有异常1
[[email protected] ~]# service iptables restart --若提示Redirecting...或者:/bin/systemctl restart iptables.service
-------------------------------
异常1:
[[email protected] ~]# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
解决:
1、关闭防火墙:[[email protected] etc]# systemctl stop firewalld
2、安装或更新服务:[[email protected] etc]# yum install iptables-services
3、启动iptables:[[email protected] etc]# systemctl enable iptables
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.
4、打开iptables:[[email protected] etc]# systemctl start iptables

[[email protected] etc]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

原文地址:https://www.cnblogs.com/xyhero/p/9343691.html

时间: 2024-08-29 00:15:09

linux安装删除telnet服务端和客户端的相关文章

centos6.6 yum安装telnet服务端和客户端

查看telent是否安装: rpm -qa | grep telnet 查看yum源上telnet有哪些软件可安装: yum search telnet telnet服务端:telnet-server telnet客户端:telnet 安装 注意,需要root权限来安装 yum -y install telnet-server yum -y install telnet 安装服务端之后其他设备就可以telnet这台设备了(这台设备有telnet服务) 安装服务端之后这台设备就可以telnet其他

linux(centos 6.4)下安装php memcache服务端及其客户端(详细教程)

前言 在搭建个人博客时,由于没有使用任何框架,纯手工code前台和后台,导致遇到许多问题,其中一个问题就是mysql连接导致的页面相应速度异常低.在查询各种途径后,只能考虑使用memcache缓存.在参考了许多文章后,终于成功的在centos6.4下安装memcache.由于发现在安装过程中,许多文章在有些细节没有解释清楚,导致我一直卡在一个问题上面.为了帮助其他可能和我遇到了同样问题的娃们,我准备也把我的安装过程详细介绍下,而不是ctrl+c,ctrl+v.希望对大家有帮助.(部分参考www.

windows服务期间rsync服务端与客户端的数据同步

一.软件 服务器端与客户端软件分别为cwRsyncServer_4.2.0和cwRsync4.2.0 下载地址为:http://www.jb51.net/softs/39404.html 二.环境介绍 server端系统为win 2003,其IP为10.240.210.88:客户端端为winXP SP3,其IP为10.240.210.206 三.安装 分别在服务端与客户端安装对应版本的软件,默认安装即可.我这里服务端的安装路径为:E:\Program Files\ICW,客户端安装路径为 四.配

(转)SVN 服务端、客户端安装及配置、导入导出项目

SVN服务器搭建和使用(一) Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说. 首先来下载和搭建SVN服务器. 现在Subversion已经迁移到apache网站上了,下载地址: http://subversion.apache.org/packages.html 这是二进制文件包的下载地址,你可在左侧的导航栏找到源代码,文档的下载地址. windows操作系统下面的二进制文件包一共有5种,如图: 个人认为最好用VisualSVN server 服务端和 To

SVN1.6服务端和客户端安装配置指导

本节向大家描述SVN1.6服务端和客户端安装配置步骤,随着SVN的快速发展,版本也进行了升级更新,本节就和大家一起学习一下SVN1.6服务端和客户端安装配置步骤,欢迎大家一起来学习.下面是具体介绍.1.软件下载下载SVN1.6服务器程序.http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91[注意]如果之前已经安装了TortoiseSVN客户端,必须选择与之配套的SVN服务端版本,否则会出现各种问题,可以从Tor

SVN服务器搭建和使用(一)--下载、安装VisualSVN server 服务端和 TortoiseSVN客户端

前言: 在http://www.cnblogs.com/xiaobaihome/archive/2012/03/20/2407610.html的博客中已经很详细地介绍了SVN的服务器--VisualSVN server和客户端--TortoiseSVN的下载与安装.但笔者在按照其中的方法进行下载.安装时发现了此文遗漏了一些重要的细节,所以本文在搬运原文的基础上补上一些遗漏的细节,帮助读者只需看本页面即可完成所有的工作,而不必像我之前那样百度好几个才弄好.   一.SVN服务器--VisualSV

CentOS 7.4安装telnet服务端

CentOS 7.4安装telnet服务端 安装xinetd服务 # yum -y install xinetd 安装telnet-server # yum -y install telnet-server telnet 修改telnet-server配置文件 [[email protected] ~]# cat /etc/xinetd.d/telnet # default: yes # description: The telnet server servestelnet sessions;

网络版shell之网络编程练习篇--telnet服务端

网络版shell之网络编程练习篇--telnet服务端 以前写过一个shell命令解释器,对与shell命令解释器的执行流程有了清晰的认识,这段时间学习网络编程,至于网络编程的细节以及知识点,已经在上 一遍博客中,转载了从网上摘的文章,基本概括了网络编程的主要api,而对于程序员,更重要的是解决实际问题的能力,所以练习是非常重要的,现在,我们在 一起shell命令解释器的基础上,写一个基于socket网络编程的网络版shell命令解释器,也可以称之为telnet服务端.  telnet服务端代码

oracle 数据库有服务端和客户端组成

数据库: 基本的概念: 数据库管理系统(Database Management System,DBMS): 管理(存储+操作(CRUD))数据的一个软件系统 关系型数据库管理系统(RDBMS): 数据库(Database):存放数据的磁盘,是RDBMS的一部分 市面上常见的数据库管理系统有哪些? ORACLE, Sql Server, Sqlite(手机数据库), DB2, Access, mysql,sybase,h2... SQL(Structure Query Language)结构化查询