PSMP - Using a target over a non-standard SSH Port (e.g. port 130)

PSMP - Using a target over a non-standard SSH Port (e.g. port 130)

102
Created On 11/10/26 10:56 AM - Last Modified 11/10/26 15:50 PM


Symptom


A psmp connection with a non-standard (22) port fails with the error message:

...This session is being recorded
ssh: connect to host fqdn.server.com port 130: Permission denied

If you set selinux on the server to Permissive mode (setenforce 0) and then test the connection, it works. 

Any connection that uses default port 22 for ssh also works with no further attention. 



Environment


14.0;14.2;14.6;15.0;15.2 Privileged Access Manager (PAM, self-hosted);Privilege Cloud PSMP

PSMP 14.x

RHEL 9.x



Cause


The PSMP SELinux policy lets PSMP's SSH client connect only to ports labeled ssh_port_t (port 22 by default) and to ports above 1023. 

Port 130 is in neither group, so SELinux blocked the outgoing connection to the target, and SSH reported it as "Permission denied".



Resolution


On RHEL psmp's add your custom port to the selinux config;

 

semanage port -a -t ssh_port_t -p tcp 130 (where your custom port is 130 for instance)

Since the PSMP server is dedicated to PSMP, this is an acceptable solution. The change is persistent and is not affected by PSMP upgrades or uninstalls.

You should be aware that this is a system-wide change. Port 130 is now treated as an SSH port for every process that SELinux allows to use SSH ports, not only for PSMP. For example, the system SSH client and the SSH server on the PSMP machine are no longer restricted by SELinux on port 130.

This does not open the port by itself: the SSH server would still need to be configured to listen on it, and the firewall would need to allow it. SELinux just no longer acts as an extra safeguard for that port.

# Alternative, if you want access limited to PSMP only

You can create a custom SELinux module that defines a dedicated port type and allows only the PSMP SSH client to connect to it, then assign your chosen port 130 to that type with semanage port. The trade-off is maintenance: the module depends on the PSMP SELinux policy, so it must be removed before each PSMP upgrade or uninstall and reinstalled afterwards.



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000kSiCAI&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail