码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Linux配置telnet服务端


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

    首先检查是否已经安装

    命令:

    rpm -qa telnet-server 
    rpm -qa xinetd
    
    • 1
    • 2

    示例:已经安装。

    [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 ~]$
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    没有安装则安装

    使用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
    
    • 1
    • 2

    暂时启动服务

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

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

    配置开机自启动

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

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

    安全配置

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

        |   | --- |
        |---| --| |     * |--| |  | \/
        |   | --- |___  | |  | |__| /\   Instance (H3Linux Release 1.1.0)
    
    
    cvknode login: root
    Password:
    Login incorrect
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    需要修改/etc/securetty文件。

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

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

    pts/0
    pts/1
    pts/2
    ...
    ...
    
    • 1
    • 2
    • 3
    • 4
    • 5

    关闭防火墙

    一般关闭
    临时关闭防火墙

    systemctl stop firewalld.service   
    
    • 1

    设置禁止开机启动防火墙

    systemctl disable firewalld.service         
    
    • 1

    防火墙相关设置命令

    • 启动: 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
  • 相关阅读:
    【推荐】javaweb JAVA JSP家政服务管理系统服务网站jsp服务信息管理jsp保姆月嫂招聘系统案例设计与实现源码
    科技视界杂志科技视界杂志社科技视界编辑部2022年第21期目录
    【Vue + Koa 前后端分离项目实战】使用开源框架==>快速搭建后台管理系统 -- part2 后端新增期刊功能实现
    驱动开发,IO模型,信号驱动IO实现过程
    数字闯关游戏HTML代码
    “简单”的无限魔方
    Qt的常用类及作用
    数据结构--顺序表的增删查改--动态分配空间
    IIC通信协议
    系统开发视角下的诊断 ———— 车身控制(B)诊断故障
  • 原文地址:https://blog.csdn.net/qq_40700822/article/details/125521195
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号