Linux配置telnet服务端

参考:
1、CentOS7环境下安装telnet服务
2、CentOS7开启telnet服务端,配合进行ssh升级
3、关闭防火墙依然无法访问服务器端口解决方案【亲测有效】

首先检查是否已经安装

命令:

rpm -qa telnet-server 
rpm -qa xinetd

示例:已经安装。

[root@cvknode ~]$ rpm -qa telnet-server
telnet-server-0.17-66.el7.x86_64
[root@cvknode ~]$ rpm -qa xinetd
xinetd-2.3.15-14.el7.x86_64
[root@cvknode ~]$

没有安装则安装

使用yum -y install telnet-server.x86_64命令安装telnet服务器,
使用yum -y install xinetd.x86_64命令安装xinetd守护进程。

yum -y install telnet-server.x86_64
yum -y install xinetd.x86_64

暂时启动服务

使用systemctl start telnet.socketsystemctl start xinetd命令启动telnet服务。

[root@localhost ~]# systemctl start telnet.socket
[root@localhost ~]# systemctl start xinetd

配置开机自启动

使用systemctl enable xinetd.servicesystemctl enable telnet.socket命令将telnet服务设置为开机自动启动。

[root@cvknode ~]# systemctl enable xinetd.service
[root@cvknode ~]# systemctl enable telnet.socket

安全配置

此时还无法使用root登录,会提示登录错误。因为默认root无法远程访问。

    |   | --- |
    |---| --| |     * |--| |  | \/
    |   | --- |___  | |  | |__| /\   Instance (H3Linux Release 1.1.0)


cvknode login: root
Password:
Login incorrect

需要修改/etc/securetty文件。

[root@localhost ~]# vim /etc/securetty

在末尾添加以下内容:添加多个可支持多个远程终端运行。

pts/0
pts/1
pts/2
...
...

关闭防火墙

一般关闭
临时关闭防火墙

systemctl stop firewalld.service   

设置禁止开机启动防火墙

systemctl disable firewalld.service         

防火墙相关设置命令

  • 启动: systemctl start firewalld
  • 查看状态: systemctl status firewalld
  • 停止: systemctl disable firewalld
  • 禁用: systemctl stop firewalld
  • 启动服务:systemctl start firewalld.service
  • 关闭服务:systemctl stop firewalld.service
  • 重启服务:systemctl restart firewalld.service
  • 服务的状态:systemctl status firewalld.service
  • 在开机时启用一个服务:systemctl enable firewalld.service
  • 在开机时禁用一个服务:systemctl disable firewalld.service
  • 查看服务是否开机启动:systemctl is-enabled firewalld.service
  • 查看已启动的服务列表:systemctl list-unit-files|grep enabled
  • 查看启动失败的服务列表:systemctl --failed
  • 查看版本: firewall-cmd --version
  • 查看帮助: firewall-cmd --help
  • 显示状态: firewall-cmd --state
  • 查看所有打开的端口: firewall-cmd --zone=public --list-ports
  • 更新防火墙规则: firewall-cmd --reload
  • 查看区域信息: firewall-cmd --get-active-zones
  • 查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0
  • 拒绝所有包:firewall-cmd --panic-on
  • 取消拒绝状态: firewall-cmd --panic-off
  • 查看是否拒绝: firewall-cmd --query-panic
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

iNBC

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值