linux下telnet安装与使用

网友投稿 644 2023-02-13

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

linux下telnet安装与使用

yum安装telnet

yum安装简单快速

1
yum install telnet-server

配置telnet

telnet是放在xinetd里,将disable改为yes,如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# vim /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
servicetelnet
{
       flags          =REUSE
       socket_type    =stream
       wait           =no
       user           =root
       server         =/usr/sbin/in.telnetd
       log_on_failure +=USERID
       disable        =no# 从yes改为no
}

如果需要使用root使用telnet登录,加上pts/0、pts1这样的,否则跳过这一步

1
2
3
4
5
# cat /etc/securetty  | grep pts
pts/0
pts/1
pts/2
pts/3

启动telnet

1
2
# service xinetd start
Starting xinetd:                                          [ OK ]

确认是否启动

1
2
# netstat -lnt | grep :23
tcp       0     0:::23                      :::*                       LISTEN

创建普通用户

如果已经有用户了,那么可以跳过这一步

1
2
3
4
5
6
# useradd # 创建用户
# passwd # 修改密码
Changing password foruser .
Newpassword:
Retype newpassword:
passwd:all authentication tokens updated successfully.

telnet连接测试

使用root登录

1
2
3
4
5
6
CentOS release6.5(Final)
Kernel3.15.4-x86_64-linode45 on an x86_64
login:root
Password:
Last login:Thu Feb1208:37:11from58.246.52.46
[root@li220-237~]#

普通用户登录

1
2
3
4
5
6
7
8
9
10
CentOS release6.5(Final)
Kernel3.15.4-x86_64-linode45 on an x86_64
login:
Password:
$w
 08:41:05up199days,21:57, 2users, load average:0.00,0.01,0.05
USER    TTY     FROM             LOGIN@  IDLE  JCPU  PCPU WHAT
   pts/1   51.241.12.49    08:40   1.00s 0.00s 0.00sw
root    pts/0   51.241.12.49    08:27   1:37  0.01s 0.01s-bash
$
上一篇:iptables作为路由器实现上网和访问控制
下一篇:运维人员应对动物袭击事件(运维人员应对动物袭击事件的措施)
相关文章

 发表评论

评论列表