PSMP - Connections are not reading SSH configurations and loading only default configuration for connections
Symptom
PSMP encounters the following errors when connecting to certain servers:
--
1.Unable to negotiate with IP port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1
--
2.Unable to negotiate with IP port 22: no matching host key type found. Their offer: ssh-rsa, ssh-dss
--
Workarounds from the below articles are applied, but not taking effect:
--
https://community.cyberark.com/s/article/Unable-to-negotiate-with-10-port-22-no-matching-host-key-type-found-Their-offer-ssh-rsa-ssh-dss https://community.cyberark.com/s/article/psmp-connection-closed-with-error-of-no-matching-host-key-type-found https://community.cyberark.com/s/article/Unable-to-negotiate-with-IP-port-22-no-matching-key-exchange-method-found-issue-after-upgrade-psmp https://community.cyberark.com/s/article/PSMP-connection-to-old-version-of-Linux-fails-with-no-matching-key-error
--
Verbose logs will show that PSMP did not read the required SSH configuration files, during initialisation of session:
--
This session is being recorded
OpenSSH_9.3p2, OpenSSL 1.0.2zh-fips 30 May 2023
debug2: resolve_canonicalize: hostname 10.191.176.1 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/PSMShadowUser/.ssh/known_hosts'
--
On a normal session, we should see similar information as below:
--
This session is being recorded
OpenSSH_9.3p2, OpenSSL 1.0.2zh-fips 30 May 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug2: checking match for 'final all' host 10.0.10.11 originally 10.0.10.11
debug3: /etc/ssh/ssh_config.d/50-redhat.conf line 3: not matched 'final'
--
Environment
12.6;13.2;14.0;14.2;14.3;14.4;14.6 Privileged Access Manager (PAM, self-hosted) PSMP
PSMP
Linux
Legacy Targets
Cause
PSMP is unable to read the ssh configuration due to incorrect permissions on /etc/ssh/ssh_config file.
Resolution
You can execute this command on the PSMP server:
==
sudo chmod 644 /etc/ssh/ssh_config
==
Doing the above will allow PSMP to read the SSH settings from the OS, and successfully apply the workaround(s) required to connect to the legacy targets.