SSH Access without password

  • View
  • Edit
  • Delete
Situation: 
If you have a jailbroken iphone you may know ( if you are geek enough ) that you can connect to the phone through ssh. That means that you can control your phone wirelessly from your computer. However, you need to type your password every time you connect to the phone (as with any other ssh connection), this is perfectly normal, but it will be better if you just can do it without having to type your password every time.

The way to do this is with 'ssh authentication keys'.

You can find the instructions here:
http://www.extrapepperoni.com/2007/09/23/openssh-on-the-iphone/

Im posting the same instructions without so many letters, if you are new to all this, I strongly recommend that you read the extrapepperoni.com instructions.

so this is what you need to type in your mac (or linux):

# ssh-keygen -t rsa

That creates 2 files (id_rsa and id_rsa.pub) , to be sure it worked type the following command:

# ls ~/.ssh/

then you have to ssh into your iphone( you should know the root's password):

#ssh root@[IPHONE IP]

once you are logged into the iphone type this:

# mkdir ~/.ssh
# chmod go-w / ~
# “echo AuthorizedKeysFile .ssh/authorized_keys >> /etc/sshd_config“

*note: type the 3rd line with quotes

type "exit" to log out the ssh or open a new terminal window and type the next line to send the previously generated key to your computer.

# scp ~/.ssh/id_rsa.pub root@[IPHONE IP]:.ssh/authorized_keys

After all that you should be able to log into your iphone/ipod touch just by typing

# ssh root@[IPHONE IP]


Powered by Drupal, an open source content management system