SSH into EC2 without Mindterm (RightScale)
Dec 28th, 2007 by Chris Kaukis - Tags: EC2, RightScale, SSH
I hate, with passion, the Mindterm application for logging into EC2 instances via SSH from our RightScale account. It opens up multiple windows, is Java based, does not do two finger scroll, and using tail -f to look at a log file is painful. That cute little terminal computer icon is quite convenient though. However, there is a way to use Terminal.app and bundled in SSH to login to your EC2 instances in RightScale (I’m using MacOS X, but should be similar for other UNIX like operating systems).
- Login into your RightScale Account
- Go to your EC2 instances
- Each instance has an SSH key you have to configure for it, click the instance link (e.g. “i-xxxxxx”)
- Scroll down under “EC2 Info” there is a “SSH Key:” with the link to the key to the right, click it
- As long as you have access to view the key, you will see “Private Key:” with “—–BEGIN RSA PRIVATE KEY—–” to the right, copy the entire key including the “—–BEGIN RSA PRIVATE KEY—–” and “—–END RSA PRIVATE KEY—–” to a text editor and save it somewhere on you computer (e.g. /Users/chris/tmp/foo_key)
- You need to chmod your private key file or SSH will complain:
chmod 0600 /Users/chris/tmp/foo_key
-
Now you can SSH in to your EC2 instance without using the RightScale Mindterm application by using the following: ssh -i /Users/chris/tmp/foo_key
root@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com
If you have DNS setup you can use the valid DNS name also. I know there is also a way to configure SSH so one doesn’t have to even type out the whole EC2 instance DNS name or path to the key file, but I have not figured that out yet (I have not tried very hard either).
Forgive me if this is obvious, but I just figured it out and figured others might like to know.
You can leave a response, or trackback from your own site.
If you use SSHKeychain you don’t even have to specify your private key.
Further more, for security sake, disable remote root access.
To make remote logins even easier, create a user account with the same user name as your local mac. then w/ SSHKeychain you just have to do “ssh hostname”. If you need root access, grant sudo access to your user account. Actions done using sudo are logged, actions done using root directly are not, so go the sudo route.