Implemented

Powershell ssh keys

0 vote

avatar

Hello Devolutions,

please would it be possible to add to your module some command like:
Get-RDMSessionPrivateSSHKey?

im working on "application" that takes passwords from RDM and injects them into custom command "rdmssh"
for details - https://github.com/MaskoFortwana/RDMcli

and I would like to expand it, so it would be possible to inject also ssh keys, but I cant find any way how to do this now.

Thank you
Michal

All Comments (4)

avatar

Hello Michal,

Apologies for the delay. A ticket has been opened to introduce a cmdlet for retrieving a session's private SSH key. I will keep you informed about the progress. Should you require further assistance, please don't hesitate to reach out.

Best regards,
Maxime

avatar

Hello,

I'm seeking to better understand the requirements. is your need to access a private key confined to instances where it is embedded directly in data, or does this also include situations where the key is stored in a file? Furthermore, is the access intended solely for when it is stored as a credential, or does this extend to other uses, such as in an SSH Shell? Clarifying these aspects will assist in ensuring the solution aligns with your needs.

Best regards,
Maxime

avatar

Hi Maxime,

My use case for this is to be able to temporary store the private key somehow, so I can pass it to my ssh session that is made outside of RDM.

If you look at my github - you can see I have made an command rdmssh.
this command do:
rdmssh root@server1
if i type this command, it will use devolutions powershell module to look up entry with username root and address server1, takes password from it, and pass it to my terminal. then the password is passed to sesson using sshpass. but of course this works only with password.

if root@server1 is entry with ssh key, the connection will fail.
but if I could download/copy the ssh key into some temp file for example /tmp/tempkey using powershell module, I could pass it to the ssh session using ssh -i parameter and then simply delete that key from /tmp.

I hope this answers your question, let me know if you need anything else.

thanks
Michal

avatar

Hello Michal,

The cmdlet 'Get-RDMEntryPrivateKey' was introduced in version 2024.1.3 of the Devolutions.PowerShell module. This cmdlet enables the retrieval of a private key from an entry. Please let us know if this meets your needs or if you require further assistance.

Best regards,
Maxime