So what are we going to do?
Well, I'm going to start with the VIM on ETC SSH,
SSH D underscore config.
And there, I'm looking up the port parameter.
Here is the port parameter.
If you look closely, two lines above,
you can see exactly what to do, SCManagePort.
But I want to show you what is going on.
If you don't do that, then I would
use systemctl restart SSH D. And oh, boy, I'm getting a message.
So systemctl status on SSH D might give me
more interesting information.
In fact, it does not.
That's disappointing.
Journalctl minus U SSH D. Is that bringing me anything?
Yeah, there we can see error.
Bind to port 2022.
Permission denied.
Now, in normal troubleshooting, you
would use set and force permissive try again.
But I can tell you it will work in permissive mode.
So I'm going to skip that step because I'm
pretty sure about myself.
And I'm going directly for the understanding.
Grab AVC on var log audit audit.log.
And what do we see?
We see denied name bind for command SSH D.
The source context is SSH D underscore T.
And the target context is unreserved port underscore T.
I can imagine that in the SELinux policy,
there is no policy at all that allows this source context
to go to this unknown target context.
So we need to figure out what to do.
One way would be to do man semanage port.
Use uppercase G to go to the end and check
if the help is useful.
And in fact, the help is very useful.
So you could copy this as well.
You know what?
I'm going to copy it so that it is done.
We don't have the right port here.
But if I paste it, the only thing I need to do
is change the port.
And that should be doing it.
But just for fun, I'm going to use journal CTL pipe
grab SCAlert as well.
I want to see what SCAlert is doing.
So here is the SCAlert message.
And I'm going to copy this SCAlert message,
including the ID in the SELinux event database
so that we can look it up.
And then I'm going to paste.
And I'm pasting it through less.
And what do we see?
It's telling us SCManage port minus A minus T port type
minus B TCP 2022.
The only thing that we need to figure out for ourselves
is from this list of three this time which port type to use.
And hey, that is what we just did, right?
So we should be OK.
And oops, I already did it.
And at this point, system CTL restart SSHD should be working.
Don't forget that you need SSH minus B 2022
to connect to localhost from now on.