Feb
01
2009

SSH Without Password By Using Public Key

SSH-ing into your device all of the time, and annoyed by having to enter your password each time? Easy fix. You just need to set up public key authentification. Here’s how to do so, step by step.

Open Terminal on your OS X / Linux pc. Then generate a pair of keys on your pc (if you haven’t done so before) by doing:

ssh-keygen -t rsa -b 2048

Accept the default location for saving the keys, and enter a passphrase (optional but strongly recommended).

Next we make a folder on the device for user |root| to contain the public key:

ssh root@youriPhonesIPadress ’mkdir -p .ssh’

(enter your password; default is |alpine| but you have changed it already using the command |password| right?)

Then we give that folder proper permissions:

ssh root@youriPhonesIPadress ’chmod 0700 ~/.ssh’

Then we move the public key to that folder on the device:

scp ~/.ssh/id_rsa.pub root@youriPhonesIPadress:.ssh/authorized_keys

And give the key proper permissions as well:

ssh root@youriPhonesIPadress ’chmod 600 ~/.ssh/authorized_keys’

Then repeat the steps (except for the first bit; you don’t want/need to regenerate a pair of keys on your pc) to do the same for user |mobile|:

ssh mobile@youriPhonesIPadress ’mkdir -p .ssh’

ssh mobile@youriPhonesIPadress ’chmod 0700 ~/.ssh’

scp ~/.ssh/id_rsa.pub mobile@youriPhonesIPadress:.ssh/authorized_keys

ssh mobile@youriPhonesIPadress ’chmod 600 ~/.ssh/authorized_keys’

Done. Test it:

ssh mobile@youriPhonesIPadress

If you don’t have to enter your password, it worked. Test for user |root| too:

exit

root@youriPhonesIPadress

exit

(Credits: these instructions are adapted from Aziz Uysal’s SSH Public Key Authentication and javacom’s How-To compile iPhone Project in Mac using Makefile instead of Xcode and fake codesign and then install to pwned iPhone posts).

 by: PiMP | in: How-To's | Tags: , | Views: 484 | Rating: 0(/2)

Rate: DownUp 0 (/2) Loading ... Loading ...

2 Comments »

 RSS feed for comments on this post.  TrackBack URL.

Leave a Comment

PiMPMiPhone.info