I have been trying to import a private key into ConnectBot for Android.
The key I’m using is working fine when using Putty, but does not work for ConnectBot.
To make it work for ConnectBot, you need to have a OpenSSH version of this file.
Luckily one can also use PuTTYgen to create an OpenSSH key.
Puttygen
In Puttygen, do the following:
- Load the private key: [File] -> [Load Private Key] (*.ppk)
- Enter passphrase if applicable
- Goto: [Conversions] -> [Export OpenSSH key] and save
Android
Now find a way to get this OpenSSH key to your Android /sdcard (root) folder.
ConnectBot
In ConnectBot, do the following:
- [Menu] -> [Manage Pubkeys]
- [Menu] -> [Import]
- Choose the OpenSSH key from /sdcard
- Click the red lock icon to load the key into memory (lock icon turns green)
- Enter passphrase/password if applicable
- (Disconnect current session)
- Connect!
You don’t assign a private key to a connection, but ConnectBot will just try any loaded key instead.
Cheers!
Please help I’m literally pulling my hair out and keep on getting timed out. I don’t have a password. Putty connecting through lan works ok with the priv key but when connecting with connectbot keeps timing out. I can ping both my dyndns name and ip associated with it currently and it’s ok. I know that you don’t need to open ports if you do the tunnelling.
Don’t know what else to do.
Thanks.
Are you sure you access the machine through lan (wi-fi) when connecting with connectbot? Aren’t you using a data connection set up by your device using the data connection from your provider?
Is connectbot only work with lan/wifi ?
It also works when connected through a mobile operator. I have it working with T-Mobile Netherlands.
When you use your router’s outside/WAN ip address as ‘host’ and a ‘port’ which are both forwarded/redirected (called NAT) on your router to the machine you have ssh running on, you should be able to connect!
thanks, excellent guide
Good. Thank you!
Thanks for posting this information! I wouldn’t have known to generate the OpenSSH key otherwise.
Thank you. Worked like a charm.
this worked perfectly. Thank you for your assistance.
Thanks a lot !
I did not notice the point of the different key format between putty and open ssh
Great guide, thanks for that explanation.
However, what way could I devise if I don’t have access to a windows pc (I.e. can’t run puttygen)??
I’ve been on the lookout for an android equiv. but nothing so far… Any idea how to bypass the absence of windows?
Hi, on Linux you can use “ssh-keygen -i -f input_keyfile > output_keyfile” to generate an OpenSSH keyfile.
Well done! This has really solved my needs on the fly. I converted my putty key and it works like a charm. Thanks!
Thank you. This was very helpful.
Thanks, it worked just like you explained. I used Openbox by the way to move my key quickly and then deleted the key off of Openbox. I know, I know, maybe not the most secure way but at least I could do it all remotely with my laptop and and tablet in hand, while watching TV.
Hi. Your instructions say “Now find a way to get this OpenSSH key to your Android /sdcard (root) folder.” – can you kindly explain how to do this? I have been unable to locate any helpful instructions.
Hi. You can do this is a lot of different ways. You can mail the file to yourself and open the mail on your phone and save it on the SDcard (I use ES File Explorer to move files around on my phone); you can take the SDcard out and put it into your PC, copy it on the SD card and place the SDcard back in the phone; you can connect the phone to your PC with USB and save the file in the SDcard folder… etc… a lot of different ways to do this.
Regards, Ian.
Hi,
Thanks for this blog. I was using this app and everything was fine. From last week, I can’t import the openssh key. I tried by reinstalling this app, but not work. Can you help me to solve this.
Hi Muhammed,
I just added a key for a jumphost and it did work. Can you be more specific on what didn’t work for you?
Did you ‘load the key into memory’, by pressing the red ‘lock’ icon to turn it green?
Regards, Ian.
Put your keys on the phone memory, not on sd card