PSMP "the server's host key does not match the one cached"

PSMP "the server's host key does not match the one cached"

213
Created On 11/10/26 11:02 AM - Last Modified 11/10/26 13:00 PM


Symptom


When a user connects to a UNIX machine via PSMP, the following message appears:
"This session is being recorded"

WARNING - POTENTIAL SECURITY BREACH! 
The server's host key does not match the one cached. 
This means that either the server administrator 
has changed the host key, or you have actually connected 
to another computer pretending to be the server. 
The new [Format] key fingerprint is: 
[Format] [Bitlength] [FingerPrint] 

Connection abandoned. 

Please contact your system administrator. 


Environment


N/A;1.5;1.6;v2.0;v2.6;v3.0;v3.3;v3.5;v3.6;3.7;v3.8;v3.9;v4.0;v4.1;v4.5;v4.6;v5.0;v5.1;v5.3;v5.5;v5.6;v5.7;v6.0;v6.1;v6.2;v6.3;v6.4;v7.0;v7.1;v7.2;v7.5;v7.6;v8.0;v8.0 Beta;8.1;v8.2;v8.5;v8.6;v9.0;v9.1;v9.2;9.3;9.5;9.6;9.7;9.8;9.9;9.9.5;9.10;10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8;v9.97;v9.8.3;v9.8.1;v9.7.5;10.9;10.10;11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0;8.3;14.2

PSMP all versions.
Connection Components:
PSMP-SSH
PSMP-SCP



Cause


The SSH Host Key is cached by the configured PSMP ClientApp (Plink,OpenSSH) for the SSH Session upon first connection to target.
 
This error occurs on subsequent connection attempts if the SSH Host Key provided during session initiation differs from the one that is cached by the PSMP ClientApp.
 
The typical cause for this error, is that the target machine SSH Host Key changed due to upgrades, a new installation of the OS, or the IP/FQDN/Hostname being used has been reprovisioned to a different system. But, as the error response also indicates, this can also be an indication of an attempted security breach.
 
This behavior is further dictated by the configuration of ServerHostKeyNotInCacheBehavior parameter in the basic_psmpserver.conf file, and how it will use/respond with the corresponding SSH Host Key File. Additional information can be found:
https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/PASIMP/Configuring-the-Verification-of-a-Servers-Host-Key.htm
By default this configuration will use "2"



Resolution


Investigate and determine the cause/reason for the SSH Host Key change on the target Server. 
If this was an expected change perform one of the resolution options below.
 
Determine what ClientApp that is in use for the Connection Component in use, This is dependent on version, and environment configuration for PSM for SSH and can be found within the PVWA:
Configuration Options >  Options > Connection Component > (Select Connection Component PSMP-SSH / SCP ) > TargetSettings

Configured under "ClientApp"
 
Example configuration:
{​PSPComponentsFolder}​​​​​​​​/plink [-{​​​​​​​​PSMProtocol}​​​​​​​​] [-P {​​​​​​​​Port}​​​​​​​​] [-L {​​​​​​​​PSMTunnelRandomPort}​​​​​​​​:127.0.0.1:{​​​​​​​​PSMTunnelTargetPort}​​​​​​​​] {​​​​​​​​Username}​​​​​​​​@{​​​​​​​​Address}​​​​​​​​
- We are looking at what is configured in Bold above.

The SSH Host keys are stored/cached in the PSMShadowusers home directory.
Using the above information will determine what file will need to change on the PSM for SSH Server:

■        For Plink: /home/PSMShadowUser/.putty/sshhostkeys
Keys for Plink should be saved in PPK format.
 
■        For OpenSSH (ssh): /home/PSMShadowUser/.ssh/known_hosts
Keys for OpenSSH should be saved in OpenSSH format.
 
Options:
A) Remove this file. It will be created again, and the ssh host keys will be cached as if this was the first time connecting to the target.
B) Update/edit the file, and remove the line with the corresponding IP/FQDN/Hostname of the target server, and it will be updated with the new SSH Host Key, on next connection.
C) Update the Fingerprint/SSH Host Key, for the corresponding line of the target server, in the correct format as noted above.
 
Additionally, the behavior responsible for this Warning, can be changed to essentially Ignore the security warning and the SSH Host Keys in use, by configuring the ServerHostKeyNotInCacheBehavior flag to "3" as outlined in the following documentation:  (Not Recommended)
https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/PASIMP/Configuring-the-Verification-of-a-Servers-Host-Key.htm



Additional Information


Details

SYMPTOM:

When a user connects to a UNIX machine via PSMP after he gets the message.

 

"This session is being recorded"

 

WARNING - POTENTIAL SECURITY BREACH! 

 

The server's host key does not match the one cached. 

This means that either the server administrator 

has changed the host key, or you have actually connected 

to another computer pretending to be the server. 

The new rsa2 key fingerprint is: 

ssh-rsa 2048 a5:af:f8:c5:51:4c:52:d1:67:39:20:4a:74:7f:bc:8a 

Connection abandoned. 

 

Please contact your system administrator. 

 

PROBLEM: 

When a user connect for the first time to an UNIX machine, a Key been added to the PSMShadow users directory.

In some cases the target machine is changing their ssh fingerprint due to upgrades or new instillation of their OS but they use the same IP address.

The next time the user logs on and try to connect will fail since there is a different key with a different fingerprint on the PSMP cache folder.

 

SOLUTION: 

 

On the PSMP machine, perform the following: 

1. On PSMP Machine with Root user Navigate to directory /home/PSMShadowUser/

2. Backup all content of the /home/PSMShadowUser/ 

3. Remove all the Files on the /home/PSMShadowUser/ directory

Note: this will delete all PSMPShadow users cache and it will be created again after first log in.

4.  Restart the sshd service /etc/init.d/sshd restart

5.  Restart the psmp service /etc/init.d/psmpsrv restart

6.  Try to connect again.

 

If the solution above does not work and PSMP connections are made via putty.

Rename /home/PSMShadowUser/.putty/sshhostkeys to sshhostkeys.old

Delete /home/PSMShadowUser/.putty/sshhostkeys

Re-test connection and new sshhostkeys file will be created with updated key.

Example command procedure:

# cd /home/PSMShadowUser/.putty/
# mv sshhostkeys sshhostkeys.old
# systemctl restart sshd
# systemctl restart psmpsrv

 

 




Actions
  • Print
  • Copy Link

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