From the course: Linux: Firewalls and SELinux

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Changing ports on services

Changing ports on services - Linux Tutorial

From the course: Linux: Firewalls and SELinux

Start my 1-month free trial

Changing ports on services

- [Sean] Depending on policy configuration services can only be allowed to run on certain port numbers, right? Attempting to change the port a service runs on without changing the policy is going to result in the service failing to start because selinux is going to stop it. You're going to use the semanage utility as the root user to list the ports that selinux allows your service to run on. Since we're using httpd as our example process throughout this course we're going to use that one, okay? So, you're going to be in as root as I am here. Just enter sudo-s and enter your password and then you're going to type in semanage and then port and we're just going to list the port, right? So -l and we're going to pipe this to grep because that's going to give us just what we're looking for here. And then -w http_port_t with the proper underscores in there. Okay, and then hit return and you're going to see that http_port_t is on tcp 80, 81, 443 488, 8008, 8009 all the standard stuff, right?…

Contents