Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Import from PuTTY/KiTTY/etc #342

Open
valdearg opened this issue Sep 16, 2024 · 9 comments
Open

[Feature Request] Import from PuTTY/KiTTY/etc #342

valdearg opened this issue Sep 16, 2024 · 9 comments

Comments

@valdearg
Copy link

Wondering if it might be possible to support importing from PuTTY/KiTTY (KiTTY being a fork of PuTTY).

The settings are stored within the registry at the below locations:

KiTTY: HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions

PuTTY: HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

This looks like the following in the regedit:

image

Fields of interest may be the:

HostName - connection hostname
UserName - username to pass to the SSH session.
Protocol - with PuTTY supporting multiple protocols, this can be ssh, telnet, serial, etc.
Autocommand - this is a command which is sent to the SSH session once logged in.

The session name would come from the registry key name, it seems to use HTML encoding so %20 as spaces etc.

@crschnick
Copy link
Member

Hmm, there is still some information missing like authentication methods such as key files. Such an import functionality would only result in incomplete connections.

Do these tools support exporting to a SSH config file?

@valdearg
Copy link
Author

Thanks for taking a look! There's a couple of options stored in the registry key regarding authentication:

Password: this seems to be an encrypted value
PublicKeyFile: this is the file path to a putty version of the public key, this comes with an extension .ppk

There is then a key for AgentFwd which means "Allow agent forwarding". PuTTY has a version of the SSH agent where the keys can be loaded into, then used globally.

Looks like there's one project here: https://github.com/abdrakhmanov/PuTTY-to-OpenSSH-Converter might be an option.

@crschnick
Copy link
Member

Yeah the password can probably not be decrypted. The key files are in a putty-specific format and there are no command-line tools from putty available to convert that into a normal .pem key on Windows. (I guess that's vendor lock in for you) XPipe already support the putty agent (pageant).

@valdearg
Copy link
Author

Yeah, they're generated by the PuTTYgen application which is doesn't look like has much of a command line interface (and can be exported out as standard openssh versions), apparently that's by design for the randomness factor in Windows. It looks like the Linux version of this does have the command line options, but probably not too relevant here I suppose.

@crschnick
Copy link
Member

Yeah without being able to convert keys I think this is going to be difficult

@valdearg
Copy link
Author

I wonder if making a little popup warning might be an option, something like "Please note: passwords and SSH key configs from PuTTY are not imported, these should be updated manually".

Then importing the configs themselves.

@crschnick
Copy link
Member

But then you still have to go through every single key in putty and export it manually and then add it in XPipe.

@valdearg
Copy link
Author

Good point there, if someone has lots it would be a pain.

Another possibility might be adding in support for the plink application, it can load sessions with the -load option and it can also take the key using -i options.

@crschnick
Copy link
Member

In theory it could just run plink -load <name>, yes. But that would not really be an import, more like another integration for a tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants