资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Linux服务器---配置telnet

建站服务器

配置telnet

阜宁网站制作公司哪家好,找创新互联建站!从网页设计、网站建设、微信开发、APP开发、成都响应式网站建设公司等网站项目制作,到程序开发,运营维护。创新互联建站2013年开创至今到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联建站

通过配置文件,我们可以设置telnet的连接时间、连接数、连接ip等,实现更加安全的连接

1 、设置连接时间,参数“access_times”

[root@localhost wj]# gedit /etc/xinetd.d/telnet

service telnet

{

flags = REUSE

socket_type = stream

wait = no

user = root

server = /usr/sbin/in.telnetd

log_on_failure += USERID

disable = no

access_times = 08:00-09:00 13:00-15:00 // 规定允许连接的时间段 8~9 点, 13~15

}

[root@localhost wj]# service xinetd restart // 重启服务

停止 xinetd [ 确定 ]

正在启动 xinetd [ 确定 ]

[root@localhost wj]# telnet 192.168.0.119 // 尝试连接

Trying 192.168.0.119...

Connected to 192.168.0.119.

Escape character is '^]'.

Connection closed by foreign host. // 连接失败

2 、设置连接数,通过参数“instances”可以设置允许的连接数,超过之后就无法再连接了

[root@localhost wj]# gedit /etc/xinetd.d/telnet

service telnet

{

flags = REUSE

socket_type = stream

wait = no

user = root

server = /usr/sbin/in.telnetd

log_on_failure += USERID

disable = no

instances = 1 // 这里设置只允许一个连接,第二个就无法连接了

}

[root@localhost wj]# service xinetd restart // 重启服务

停止 xinetd [ 确定 ]

正在启动 xinetd [ 确定 ]

[root@localhost wj]# telnet 192.168.0.119 // 第一个连接

Connected to 192.168.0.119.

login: david

Password:

Last login: Thu Aug 16 09:10:22 from 192.168.0.119

already login // 成功

[root@localhost wj]# telnet 192.168.0.119 // 第二个连接

Connected to 192.168.0.119.

Connection closed by foreign host. // 失败

3 、允许/禁止特定的ip或者网段登录,参数“only-from”“no_access”

[root@localhost wj]# gedit /etc/xinetd.d/telnet

service telnet

{

flags = REUSE

socket_type = stream

wait = no

user = root

server = /usr/sbin/in.telnetd

log_on_failure += USERID

disable = no

only_from = 192.168.0.113 // 只允许 113 连接

# only_from = 192.168.0.0/24 // 允许 1~254 连接

# only_from = 192.168.0.100-192.168.0.200 // 允许 100~200 连接

# only_from = 192.168.0. // 允许 113 114 连接

# no_access = 192.168.0.113 // 禁止 113 连接,其他写法同上

}

4 、允许root连接。只要将文件“/etc/securetty”删除,那么系统读不到这个文件,自然就会永续root登录

[root@localhost wj]# mv /etc/securetty /etc/securetty.bak // 重命名该文件

[root@localhost wj]# service xinetd restart // 重启服务

停止 xinetd [ 确定 ]

正在启动 xinetd [ 确定 ]

[root@localhost wj]# telnet 192.168.0.119 // 连接

Trying 192.168.0.119...

Connected to 192.168.0.119.

login: root // 使用 root 用户连接

Password:

Last login: Thu Aug 16 07:51:45 from 192.168.0.119

already login // 连接成功

做了一个Linux学习的平台,目前出来一个个形,各位可以参考使用
链接: https ://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ密码:n7bk


网页标题:Linux服务器---配置telnet
标题网址:http://cdkjz.cn/article/chcdid.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220