Ubuntu – How to connect to the Amazon EC2 server using a desktop client

amazon ec2server

I've already setup an Amazon EC2 instance running 10.10 and am able to connect to it using the ssh command provided by Amazon. I noticed there is a 'Terminal Server Client' and a 'Remote Desktop Viewer' included with Ubuntu, and I was wondering if it's possible to use either of these to connect to my server. It would be a far more convenient than typing out the rather long ssh command (after first navigating to the directory in which my key is stored).

I've had a few tries at connecting with both of them, but the problem is I don't know what I should be putting in the fields since all the documentation provided by both Amazon and Ubuntu assume I already know what I'm doing with servers.

Update: From reading the answers it seems I've left out a crucial piece of information. I wish to administer my server using a terminal. My question is about making the connection process as simple as possible.

Best Answer

I think you're asking how you can shorten the following command:

ssh -i ~/path/to/your/ssh_key.pem \
   ubuntu@ec2-79-125-64-190.eu-west-1.compute.amazonaws.com

That can be accomplished with with edits to ~/.ssh/config. The following example ssh config stanza might be helpful:

Host myec2server
  IdentityFile /home/USERNAME/ec2/ec2-keypair.eu-west-1.pem
  User ubuntu
  HostName ec2-79-125-64-190.eu-west-1.compute.amazonaws.com 

Now, you can just type ssh myec2server. see man ssh_config for more ssh_config tricks. You can then combine that with another of the answers here and create a launcher with the command:

gnome-terminal --execute ssh myec2server  

Also related, is a new-ish EC2 feature import-keypair that allows you to upload your own public keys. Then, you can launch new servers with keypairs that you use elsewhere.

Related Question