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] ssh2debug3: Failed to open file:C:/Windows/.ssh/authorized_keys error:2root instead of the service user (igx).authorized_keys in C:\Windows\.ssh instead of the user profile.authorized_keys file (requires SYSTEM/Administrators only).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.
wildfly-ssh-keymgr --generate <key_name>wildfly-ssh-keymgr --listwildfly-ssh-keymgr --export <key_name> Note: Copy the resulting string to the target machine's authorized_keys file.authorized_keys file.Run all commands as the user running the IM application server (typically igx).
ssh-keygen -f /home/igx/.ssh/<key_name> -N ""/home/igx/.ssh/<key_name>.pubauthorized_keys file./root/.ssh/authorized_keys or the specific service user's home directory.C:\Users\<UserName>\.ssh\authorized_keys..ssh folder to C:\Windows\.ssh\.PX should invoke a shell script to handle the SSH command.
/home/igx/test_ssh): ssh -o StrictHostKeyChecking=no -i /opt/CA/VirtualAppliance/conf/wildfly-ssh-keys/<key_name> user@<target_host> "mkdir /root/NewFolder"/home/igx/test_ssh
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.