当前位置:网站首页>telnet安装以及telnet(密码正确)无法登录!
telnet安装以及telnet(密码正确)无法登录!
2022-07-25 19:03:00 【Lfei5120】
telnet安装以及telnet(密码正确)无法登录!
文章目录
1.telnet下载
先在yum源当中查找是否有这两个安装包
test login: Connection closed by foreign host.
[[email protected] xinetd.d]# 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] xinetd.d]#
如上述我们查到了有两个安装包
2.安装telnet
[[email protected] xinetd.d]# yum -y install telnet
[[email protected] xinetd.d]# yum -y install telnet-server
3.telnet安装成功之后我们启动telnet
由于telnet下载默认是存放在xinetd当中,但是我们启动xinetd发现没有这个依赖包。
[[email protected] xinetd.d]# service xinetd start
Redirecting to /bin/systemctl start xinetd.service
Failed to start xinetd.service: Unit not found.
[[email protected] xinetd.d]#
4.下载xinetd,并重启xinetd
[[email protected] xinetd.d]# yum -y install xinetd
[[email protected] xinetd.d]# service xinetd start //启动成功
Redirecting to /bin/systemctl start xinetd.service
[[email protected] xinetd.d]#
[[email protected] xinetd.d]# ls /etc/xinetd.d/ //但是我们查看发现并没有telnet,所以我们要自己创建
chargen-dgram daytime-dgram discard-dgram echo-dgram tcpmux-server time-dgram
chargen-stream daytime-stream discard-stream echo-stream telnet time-stream
[[email protected] xinetd.d]#
5.创建telnet,并且写入文本内容
注意的是,这文本里的第一行disable中的yes要改成no
[[email protected] xinetd.d]# cd /etc/xinetd.d/
[[email protected] xinetd.d]# vi telnet
[[email protected] xinetd.d]# cat telnet
service telnet
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
[[email protected] xinetd.d]#
查看一下端口号
[[email protected] xinetd.d]# netstat -tnl grep 23 //telnet默认端口23,下面已查出telnet端口号
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
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
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::23 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
[[email protected] xinetd.d]#
在此telnet就以及配置完成了。
6.telnet(密码正确)无法登录
在这里我们telnet但是如果用户密码正确,还是不能登录,那么我们可以直接ssh连接进去进行配置更改
[[email protected] ~]# cat /etc/pam.d/login //注意这里将第二行auth [...注释掉,然后保存退出
#%PAM-1.0
#auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.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 system-auth
session include postlogin
-session optional pam_ck_connector.so
[[email protected] ~]#
7.重启telnet
[[email protected] ~]# service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service
[[email protected] ~]#
8.添加pts/0并重启
默认情况下linux都是认为pts0是不安全的连接,所以会拒绝掉,那么我可以放行pts0,在这里拉菲不介绍太多,如果要问怎么看,可以去/var/log/securre里面查询是那个被拒绝掉了霍。。。。
[[email protected] ~]# cat /etc/securetty //进入这个文件,在最后一行添加pts/0
console
vc/1
vc/2
略。。。。。
pts/0
[[email protected] ~]#
重启xinetd
[[email protected] ~]# service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service
[[email protected] ~]#
重启完就可以再连接,输入用户和密码就可以进去啦!!!
点个关注不迷路,博客就看拉菲为你精彩解说。
边栏推荐
猜你喜欢

MES管理系统有什么应用价值

Process communication (Systemv communication mode: shared memory, message queue, semaphore)

JS 基本类型 引用类型 深/浅克隆复制

SQL Server 2019 安装教程

Youth, oh, youth

How to change the chords after the tune of the song is changed

进程通信(SystemV通信方式:共享内存,消息队列,信号量)

Excellent test / development programmers should make breakthroughs and never forget their original intentions, so that they can always

对迁移学习中域适应的理解和3种技术的介绍

优秀的测试/开发程序员突破,不忘初心,方得始终......
随机推荐
APP测试点(思维导图)
Go代码检查工具
基于Mysql-Exporter监控Mysql
srec_cat 常用参数的使用
优维低代码:Use Resolves
浅析IM即时通讯开发出现上网卡顿?网络掉线?
微软Azure和易观分析联合发布《企业级云原生平台驱动数字化转型》报告
The difference between PHP equal to = = and identity equal to = = =
【小程序开发】你了解小程序开发吗?
软件测试流程(思维导图)
网上商城系统MySql数据库设计项目实战
Pixel2Mesh从单个RGB图像生成三维网格ECCV2018
ThreadLocal Kills 11 consecutive questions
In the first half of the year, the shipment volume has exceeded that of the whole year of last year, and centritec millimeter wave radar has "captured" the international giant
Circulaindicator component, which makes the indicator style more diversified
How to design product help center? The following points cannot be ignored
Is Cinda securities a state-owned enterprise? Is it safe to open an account in Cinda securities?
如何创建一个有效的帮助文档?
GDB help
银行理财子公司蓄力布局A股;现金管理类理财产品整改加速