9

How do I generate a pair of SSH keys to be able to use in several apps (Juice SSH, Turbo, etc) to access my remote host? I've tried generating them with Connectbot, JuiceSSH and on a Linux machine, but none seem to work...

EDIT: I've generated the keys the way I usually do, with ssh-keygen -t rsa -b 4096, copied the private key to a ssh/ folder on my phone's internal memory (which I later point to in the client software) and added the public key to the .ssh/authorized_keys file on my server.

Izzy
  • 91,166
  • 73
  • 343
  • 943
joaocandre
  • 221
  • 1
  • 2
  • 6
  • OK – then it looks good to me, and should work. I'm pretty sure I used RSA as well, and almost sure on the 4k. So I don't see where it should fail here. But thanks for filling the gaps – hopefully this enables someone else to spot a thing. – Izzy Mar 12 '15 at 12:43
  • You need to see : http://stackoverflow.com/questions/10271197/openssl-how-to-extract-public-key – pRaNaY Aug 31 '16 at 06:56
  • This should also work http://android.stackexchange.com/questions/73555/how-can-i-create-a-key-par-for-sgit – warsong Jan 26 '17 at 11:53

2 Answers2

3

You could install Termux, a terminal shell with additional Linux functionality on top of Android, with a package manager, so you can scale the magnitude of native Linux functionality at will. Then enter

pkg install openssh

Key-pairs in different formats will be generated upon OpenSSH install.

iBug
  • 7,747
  • 8
  • 44
  • 83
Rob
  • 41
  • 3
1
  1. Install Termux from Google Play Store
  2. Open Termux and execute pkg install openssh
  3. Installation scripts automatically generates four public/private key pairs at /data/data/com.termux/files/usr/etc/ssh/ folder for RSA, DSA, ECDSA, and ed25519 encryption algorithms.
  4. If you prefer to do it manually and setup a passphrase just execute ssh-keygen -t rsa -b 4096 and follow the process.