SSH Key-Based Authentication for Identity Manager vApp and Non-vApp Environments
search cancel

SSH Key-Based Authentication for Identity Manager vApp and Non-vApp Environments

book

Article ID: 196345

calendar_today

Updated On:

Products

CA Identity Governance CA Identity Manager CA Identity Portal CA Identity Suite

Issue/Introduction

Attempts to use SSH authentication (e.g., via Policy Xpress or command line) fail with "Permission denied" errors.

Symptoms:

  • Warning: Identity file /opt/CA/VirtualAppliance/conf/wildfly-ssh-keys/imadmin_key not accessible: Permission denied.
  • sshd: Failed password for ssh_user from [IP] port [Port] ssh2
  • OpenSSH logs showing: debug3: Failed to open file:C:/Windows/.ssh/authorized_keys error:2



Environment

  • Identity Suite: 14.x, 15.x
  • Deployment: Virtual Appliance (vApp) or On-Premise (Non-vApp)

Cause

  1. Context Mismatch: Commands are executed as root instead of the service user (igx).
  2. Missing Export: Keys were generated but the public key was not exported/distributed to the target.
  3. Directory Pathing (Windows): Windows OpenSSH may look for authorized_keys in C:\Windows\.ssh instead of the user profile.
  4. Permissions: Incorrect NTFS permissions on the authorized_keys file (requires SYSTEM/Administrators only).

Resolution

1. Virtual Appliance (vApp) Configuration

Key-based authentication is designed to work through Policy Xpress via the igx user running Wildfly. Do not execute these as root at the OS level.

  • Generate the key pair: wildfly-ssh-keymgr --generate <key_name>
  • List existing keys: wildfly-ssh-keymgr --list
  • Export the public key: wildfly-ssh-keymgr --export <key_name> Note: Copy the resulting string to the target machine's authorized_keys file.
  • Multi-Node Clusters: Keys are not replicated. You must generate/export unique keys for each node and concatenate all public keys into the target's authorized_keys file.
2. Non-vApp (On-Premise) Configuration

Run all commands as the user running the IM application server (typically igx).

  • Generate key pair: ssh-keygen -f /home/igx/.ssh/<key_name> -N ""
  • Public key location: /home/igx/.ssh/<key_name>.pub
  • Multi-Node Clusters: Keys are not replicated. You must generate/export unique keys for each node and concatenate all public keys into the target's authorized_keys file.
3. Target Machine Setup
  • Linux Targets: Add the public key to /root/.ssh/authorized_keys or the specific service user's home directory.
  • Windows Targets (OpenSSH):
    • Add the public key to C:\Users\<UserName>\.ssh\authorized_keys.
    • Troubleshooting Pathing: If logs indicate a failure to find the file, move the .ssh folder to C:\Windows\.ssh\.
    • Permissions: Ensure ONLY SYSTEM and Administrators have "Full Control." Remove all other users/groups.
4. Policy Xpress (PX) Implementation

PX should invoke a shell script to handle the SSH command.

  • Example Script (/home/igx/test_ssh): ssh -o StrictHostKeyChecking=no -i /opt/CA/VirtualAppliance/conf/wildfly-ssh-keys/<key_name> user@<target_host> "mkdir /root/NewFolder"
  • PX Action Rule:
    • Category: External Code
    • Type: Execute Command Line
    • Command: /home/igx/test_ssh

 

Additional Information

If you are getting an error such as the following in the Windows Event Viewer under the OpenSSH Operational log:

sshd: Failed password for ssh_user from ###.###.#.### port 34976 ssh2

Then it can be helpful to enable DEBUG level logging for sshd but since we do not have permissions to edit the /etc/ssh/sshd_config file on the vApp node to set DEBUG logging you can instead set up the logging on the Windows side by editing the C:\ProgramData\ssh\sshd_config file where you would need to set the following two properties and then restart the "OpenSSH SSH Server" service:

SyslogFacility LOCAL0
LogLevel Debug3

You can then repeat another test case and can check the C:\ProgramData\ssh\logs\sshd.log for errors perhaps such as the following error:

8152 2024-11-20 02:56:04.789 debug1: trying public key file C:\\Windows\\.ssh/authorized_keys
8152 2024-11-20 02:56:04.790 debug3: Failed to open file:C:/Windows/.ssh/authorized_keys error:2
8152 2024-11-20 02:56:04.790 debug1: Could not open authorized keys 'C:\\Windows\\.ssh/authorized_keys': No such file or directory

At this point you could move the .ssh\authorized_keys from the C:\Users\ssh_user location to the C:\Windows location since for whatever reason that is where the Windows machine is looking for it. Restart the "OpenSSH SSH Server" service again and retest again and see if it works or if there is additional errors related to permission such as:

7760 2024-11-20 02:58:31.303 debug1: trying public key file C:\\Windows\\.ssh/authorized_keys
7760 2024-11-20 02:58:31.304 debug3: Bad permissions. Try removing permissions for user: ##### on file C:/Windows/.ssh/authorized_keys.
7760 2024-11-20 02:58:31.305 Authentication refused.

8580 2024-11-20 03:06:23.116 debug1: trying public key file C:\\Windows\\.ssh/authorized_keys
8580 2024-11-20 03:06:23.118 debug3: Bad permissions. Try removing permissions for user: ##### on file C:/Windows/.ssh/authorized_keys.
8580 2024-11-20 03:06:23.118 Authentication refused.

If so then check the security properties of the C:\\Windows\\.ssh\authorized_keys file. It could be that it has additional non-Full Control settings in which case try to modify the security on the file to remove everything except for SYSTEM and Administrators which both should have Full Control of the file. Restart the "OpenSSH SSH Server" service again and retest again and see if it now works.