If you are Wondering or having difficulties importing Private SSH key to Juice SSH, then this is one might helps you.
JuiceSSH supports OpenSSH PEM format private keys. Whilst we hope to add key generation and public key exporting soon, this is not yet in place. In the meantime, the quickest way to use a private key with JuiceSSH is to copy the key file to your device’s SD-Card and then associate the key with an identity via Smart Search.
First, you need to convert the Key
Windows:
- Download and install puttygen from the Putty website
- Open the PPK private key in puttygen and click Conversions -> Export OpenSSH key
- Place the resulting openssh format private key on your device (via usb/email/dropbox etc)
- Create/update an identity in JuiceSSH and use the Smart Search to automatically find the key.
Linux/Mac OSX:
- Linux:
sudo apt-get install putty-tools
- Mac OSX:
brew install putty
puttygen id_dsa.ppk -O private-openssh -o id_dsa
Second, import the key
To do so:
- Copy your private key file to your device, via a trusted method. E.g. USB.
- Open JuiceSSH, navigate to Connections and swipe left to Identities.
- Create or update an identity. (Long press + Edit to update.)
- Ensure that the Username is set for the identity
- Hit “Set (Optional)” to set a Private Key.
- Select “Smart Search” to fire off a multi-threaded search of your sd-card. Alternatively, paths can be entered relative to your sd-card’s root.
- Select your key file and hit “OK”
- Save your identity.
Now, when you create connections, you should be able to select your private key enabled identity and then authenticate as expected.
If your key file is still not being found by Smart Search, you can see the exact method which is used to check each file here.
It reveals that the criteria for being recognised as a valid key file are:
- File size < 8kb
- First 37 chars contain one of:
- “—–BEGIN RSA PRIVATE KEY—–“
- “—–BEGIN DSA PRIVATE KEY—–“
- “—–BEGIN PRIVATE KEY—–“
- “—–BEGIN ENCRYPTED PRIVATE KEY—–“