Unable to manage SSH Keys of PSMP Maintenance Users.
Symptom
Unable to manage SSH Keys of a PSMP Maintenance Users - When trying to rotate the SSH key of a PSMP Maintenance User the following error is seen in the third-party debug log:
Error message - ERROR -> Verify :: run() -> Verify phase - Cannot connect to target machine. More info: No such host is known
or
ERROR -> BaseAction`1 :: ConnectToMachine -> GotException: Expect.NET.SshKeyAuthenticationException: Permission denied (publickey) ---> Rebex.Net.SftpException: SFTP subsystem request has failed.
Environment
Privileged Access Manager (PAM, self-hosted);Privilege Cloud Central Policy Manager (CPM)
- PAS
- PSMP
Cause
During PSMP hardening SFTP is disabled in the sshd_config. The SSH Key Rotation Process uses SFTP to transfer the keys between the target and the CPM.
Resolution
- Enable the SFTP in the sshd_config
- Remove the hash (#) from the following lines in the SSHD_config
#sftp internal-sftp
#Subsystem sftp /usr/libexec/openssh/sftp-server
* If the lines do not exist please add it to /etc/ssh/sshd_config without the #
* For the change to take effect you need to stop the PSMP and restart SSHD service then start the PSMP service once more:
-systemctl restart sshd
-systemctl restart psmpsrv
Note:
The customer needs to decide whether they would like to undo this part on the hardening which we advise during the installation of PSMP.
Note:
If the installed psm for ssh is on RHEL 8.7 or above and you want to manage the private key for the proxymng account "#sftp internal-sftp" does not exist as a line in the sshd_config file. If you try to add it, the sshd service will error out on restart.
"#Subsystem sftp /usr/libexec/openssh/sftp-server" does exist in the sshd_config and when uncommented, sshd_config restarts, the desired results are achieved (able to manage ssh key pair for proxymng user)
Additional Information
Details
SYMPTOM:
Unable to manage SSH Keys of a PSMP Maintenance Users.
When trying to rotate the SSH key of a PSMP Maintenance User. The following error is seen in the third party debug log.
Error message - ERROR -> Verify :: run() -> Verify phase - Cannot connect to target machine. More info: No such host is known
PROBLEM:
During PSMP hardening SFTP is disabled in the sshd_config.
The SSH Key Rotation Process uses SFTP to transfer the keys between the target and the CPM.
SOLUTION:
Enable the SFTP in the sshd_config
Remove the hash (#) from the following lines in the SSHD_config
#sftp internal-sftp
#Subsystem sftp /usr/libexec/openssh/sftp-server
If the lines do not exist please add it to /etc/ssh/sshd_config without the #
For the change to take affect you need to stop the PSMP and restart SSHD service then start the PSMP service once more.
service psmpsrv stop
service sshd restart
service psmpsrv start
Note: - The customer needs to decide whether they would like to undo this part on the hardening which we advise during the installation of PSMP.