zoukankan      html  css  js  c++  java
  • centos7修改服务端口(ssh为例)

    修改SSH服务端口

    cd /etc/ssh/
    
    vim sshd_config
    #增加服务的端口

    向防火墙中添加修改的端口

    #向防火墙中添加端口
    firewall-cmd --zone=public --add-port=10022/tcp --permanent
    firewall-cmd --reload

    #
    查看端口是否添加成功
    firewall-cmd --zone=public --query-port=10022/tcp

    向SELinux中添加修改的SSH端口

    在向SELinux中添加端口之前需要先安装SELinux的管理工具

    yum provides semanage

    yum install policycoreutils-python -y
    #查询当前 ssh 服务端口
    semanage port -l | grep ssh
    
    #向 SELinux 中添加 ssh 端口:
    semanage port -a -t ssh_port_t -p tcp 10022
    
    #重启
    systemctl restart sshd.service
  • 相关阅读:
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    How to build and run ARM Linux on QEMU from scratch
    How to debug Android Native Application with eclipse
  • 原文地址:https://www.cnblogs.com/yellowzunzhi/p/12897402.html
Copyright © 2011-2022 走看看