iSSH has a great little feature to generate it's own key and then transfer that key to any machine you want, but it requires that you know the password for that machine. When it comes to EC2 instances, I've never used a password and to my knowledge, there isn't a user account with a password on them. Problem.
After posting on the iSSH google group asking if there was going to be a way to transfer a key to iSSH, Chris Jones responded that I might be able to connect if I could associate multiple keys with my AWS account. I looked into this and discovered that, no, Amazon does not let you associate multiple X.509 certificates with an AWS account. However, in this process, I realized that there wasn't anything stopping me from adding iSSH's public key to the authorized_keys file on the machine I wanted to connect to.
Here's the steps:
- If you don't have one already, install a SSH server on you computer. I have a macbook pro running OS X 10.5, so all I had to do was enable remote login from the System Preferences, which enables the SSH server under the hood.
- Use iSSH's transfer function to transfer the iSSH key to your computer.
- Copy the iPhone iSSH key from ~/.ssh/authorized_keys (if you have multiple, it will be indicated with a comment following the key of the type "iphone-rsa-key-<SOME_NUMBER>
") - Add the key to the ~/.ssh/authorized_keys file of the EC2 instance you want to connect to.
Viola! Key-based authentication allowing iSSH to connect to an EC2 machine, or any machine for that matter. If you chose to have iSSH use a password/passphrase when creating its' key, you'll have to enter this whenever you connect, but that's probably a good thing in case you lose your phone...

2 comments:
woah! freakin awesome. nice post
Thanks for this, also works for TouchTerm for the iphone
Post a Comment