Last active
November 2, 2021 06:40
-
-
Save Green-li/a818732858ef9351c4f942c06853ca5f to your computer and use it in GitHub Desktop.
open port on SELinux Centos 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Start with checking the port allocation and confirming the port you want to allow access to isn't already being used, | |
`sudo semanage port -l | grep http_port_t` | |
2. Allow access to port | |
`sudo semanage port -a -t http_port_t -p tcp 12345` | |
3. Check firewall ports passthrough | |
`sudo firewall-cmd --list-all` | |
4. Add port (and make it permanent) | |
`sudo firewall-cmd --zone=public --add-port=12345/tcp --permanent` | |
5. Reload firewall for the changes to take effect | |
`sudo firewall-cmd --reload` | |
6. Check firewall ports passthrough | |
`sudo firewall-cmd --list-all` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment