8

CentOS 8修改ssh默认端口

 1 year ago
source link: https://vpsxb.net/6071/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

CentOS 8修改ssh默认端口

> 网络资源 > CentOS 8修改ssh默认端口
202206191902179.png

1、编辑sshd配置文件,将#Port 22取消注释改成您想修改的端口,如:22345

vi /etc/ssh/sshd_config

2、将新端口添加至防火墙规则

firewall-cmd --zone=public --add-port=22345/tcp --permanent 
firewall-cmd --reload

3、向SELinux中开放新端口,需要先安装semanage及其依赖包policycoreutils-python-utils:

yum provides semanage 
yum -y install policycoreutils-python-utils

添加开放端口:

semanage port -a -t ssh_port_t -p tcp 22345

4、重启SSHD服务

systemctl restart sshd.service

此时就可以用新端口连接了


VPS小白 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:CentOS 8修改ssh默认端口

Recommend

  • 57
    • www.linuxprobe.com 6 years ago
    • Cache

    Linux之ssh服务默认端口修改

    导读 SSH是标准的网络协议,可用于大多数UNIX操作系统,能够实现字符界面的远程登录管理,它默认使用22号端口,采用密文的形式在网络中传输数据,相对于通过明文传输的Telnet,具有更高的安全性。因为公司业务需求,可能涉及到更改ssh远程的端口号,用下面...

  • 37

  • 79

    最近在写 memcached 系列文章的时候,为了了解客户端和memcached之间的通信,使用wireshark分析了相关流量,但遇到了一个问题,觉得挺典型的,为此分享一下。 memcached 为了分析 memcached 流量,需要特定的解码器(默认是支持...

  • 11
    • www.wencst.com 4 years ago
    • Cache

    windows修改默认远程桌面端口

    windows修改默认远程桌面端口 作者: wencst 分类: Uncategorized,windows 发布时...

  • 9
    • xmanyou.com 3 years ago
    • Cache

    #Ubuntu 更改ssh默认连接端口

    8 March 2021 / Ubuntu #Ubuntu 更改ssh默认连接端口 ssh默认的连接端口是22 但是,为了安全起见,一般会改成其他端口,具体步骤如下...

  • 7
    • www.itpwd.com 3 years ago
    • Cache

    CentOS 6.10修改SSH端口笔记

    CentOS 6.10修改SSH端口笔记_Linux笔记_IT密码[root@localhost ~]# vim /etc/ssh/sshd_config #Port 22 Port 18022 #新增ssh端口 [root@localhost ~]# service sshd restart [root@localhost ~]# [root@localhost ~]# vi /etc/sysconfig/iptables -A...

  • 14
    • www.javatang.com 3 years ago
    • Cache

    CentOS 7修改SSH端口之后启动失败

    CentOS 7修改SSH端口之后启动失败 – 爪哇堂 JavaTangSkip to main content

  • 8
    • www.myfreax.com 2 years ago
    • Cache

    Linux SSH 端口修改

    ssh Linux SSH 端口修改 默认情况下,SSH监听端口22。更改默认SSH端口可降低自动攻击的风险,从而为服务器增加一层安全保护

  • 8
    • www.v2ex.com 2 years ago
    • Cache

    surge 怎么修改默认端口?

    V2EX  ›  Surge surge 怎么修改默认端口?   Davic1...

  • 3
    • benpaodewoniu.github.io 1 year ago
    • Cache

    aws | 修改 SSH 端口忘记打开防火墙

    aws | 修改 SSH 端口忘记打开防火墙 2024-03-29...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK