玟茵开源社区知识库

如果您有自己的想法或者金点子,请提交给我们或直接参与项目,在此欢迎各位,您的反馈是我们持续前进的动力。
  1. 首页
  2. 设置文档
  3. 正文

Allow ssh port on SELinux

2023年7月6日 476点热度 0人点赞 0条评论

文章目录[隐藏]

  • Step 3: Allow new SSH port on SELinux
  • Step 4: Open SSH port on Firewalld

Step 3: Allow new SSH port on SELinux

The default port labelled for SSH is 22.

$ semanage port -l | grep ssh
ssh_port_t                     tcp      22

If you want to allow sshd to bind to network port configured, then you need to modify the port type to ssh_port_t.

sudo semanage port -a -t ssh_port_t -p tcp 2200

Confirm that the new port has been added to list of allowed ports for ssh.

$ semanage port -l | grep ssh
ssh_port_t                     tcp      

2200, 22

Step 4: Open SSH port on Firewalld

It is always recommended to keep the Firewall service running and only allow trusted services.

sudo firewall-cmd --add-port=2200/tcp --permanent
sudo firewall-cmd --reload
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可
标签: 暂无
最后更新:2023年7月7日

WenYinOS

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

COPYLEFT © 2023 玟茵开源社区知识库. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang