五月 12th, 2018

默认在CentOS-Minimal版本下没有安装telnet和xinetd服务。

  • 安装telnet

# rpm -qa | grep telnet

–检查是否安装telnet,没有文件表示未安装

# yum -y install telnet

–安装telnet客户端,出现“Complete!”表示安装完成

# yum -y install telnet-server

–安装telnet服务端,出现“Complete!”表示安装完成

 

2、安装xinetd

# rpm -qa | grep xinetd

–检查是否安装xinetd,没有文件表示未安装

# yum -y install xinetd

–安装xinetd,出现“Complete!”表示安装完成

 

3、在xinetd服务中开启telnet服务

# vi /etc/xinetd.d/telnet  –编辑

# default: yes
# description: The telnet server servestelnet sessions
# 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
}

 

4、启动xinetd服务

# systemctl restart xinetd.service  –启动服务

# ps -ef | grep xinetd  –查看启动

 

5、设置开机启动xinetd

# chkconfig –level 35 xinetd on

Note: Forwarding request to ‘systemctl enable xinetd.service’.

# systemctl enable xinetd.service

# chkconfig –list  –查看

 

6、测试telnet

# telnet 127.0.0.1

telnet下root登录,密码正确,总提示:Login incorrect

 

# vi /etc/pam.d/remote

注释/etc/pam.d/remote的第一行,即:auth required pam_securetty.so

 

关闭防火墙

# systemctl status firewalld.service –再查看防火墙状态
# systemctl stop firewalld.service –关闭防火墙
# systemctl disable firewalld.service –永久关闭防火墙

 

TAGS: ,

Comments are closed.