CentOS 9 Stream update broke my SSH server with custom port because of SELinux
Daniel Nashed – 17 May 2025 16:32:58
I just patched my CentOS 9 Stream server to the latest version.
The server came up, but SSH did not work any more.
It turned out that the SELinux enforced mode in combination with the policies for sshd was responsible for it.
My server runs on a custom SSH port.
I had to add that port to my SELinux condfiguration. Let's assume you want to add 123.
You would need to allow the port like this:
semanage port -a -p tcp -t ssh_port_t 123
But first you need to make sure you have the enforced SELinux mode at all with this command:
getenforce
Enforcing
You should check the SELinux settings for the SSH port before and after the change via:
semanage port -l | grep ssh
I have not seen this on any other update like Ubuntu.
But the latest CentOS patches caused this to one of my servers.
Maybe this helps in one or another case.
I am migrating most of my servers to Ubuntu. But I am keeping some for testing.
-- Daniel
- Comments [0]