7

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.

1
  • You can ssh into the instance, and install the gnome-desktop, then either allot an elastic IP to that instance, and open up a port from the security groups, or use the public DNS provided by amazon. Ill try it and let you know. Jan 26, 2011 at 3:29

5 Answers 5

6

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

ssh -i ~/path/to/your/ssh_key.pem \
   [email protected]

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.

1

You tend not to run desktop instances (that is the full X/GDM/Gnome stack) on server. That graphics stack eats tons of RAM and that very much equates to money when you're talking about EC2.

In short, I think if you're trying to VNC in, you've probably the wrong end of the stick. You certainly can install X et al on a server and then you can install TightVNC (or other) to provide graphical access over network... But if you're just trying to administer a system, learn to use the console and live without it, or use a webmin solution.

2
  • I'm undeleting this answer because of @Kaustubh's answer. Installing ubuntu-desktop on a server just for administration is almost always the wrong thing to do.
    – Oli
    Jan 26, 2011 at 12:24
  • I couldnt agree with you more. Granted that we are spoiled on GUI, but server administration is always best served via command-line, and has infact made me fall in love with the terminal ;) Jan 27, 2011 at 5:53
1

Can you not just make a launcher? Something that runs:

gnome-terminal -e "cd where_your_key_is; your amazon command"
0

Assuming your ec2 instance isn't running a graphical user interface,'Terminal Server Client' and 'Remote Desktop Viewer' are used to connect to graphical sessions on desktop computers.

If you find typing the ssh commands tedious, you can set up an alias to get a shorter command or use @Oli's method to create a Launcher for your Main Menu.

0

Ok, heres what you do, thanks a lot to Chipaca! I owe you one!

  1. ssh into the amazon instance.

  2. install the ubuntu-desktop and tightvncviewer: (might need an update before installing)

    sudo apt-get install ubuntu-desktop tightvncserver

  3. On your local machine install the client:

    sudo apt-get install xtightvncviewer

  4. On the server type this command to start the server:

    tightvncserver -geometry 800x600

    You can change the resolution to suit your need, but 800x600 did the job for me.

  5. On your client, type this command:

    xtightvncviewer -via ubuntu@<YourInstance's-Dns-Or-Ip> -compresslevel 9 -quality 5 :1

PS: I tried this on ami-ccf405a5 with a ebs backed storage.
PS1:Pressing F8 in the viewer will show you a menu.

You must log in to answer this question.