Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

< NEW >

My apologies, I didn't explain my goal very well.

I want to automatically "log onto" and start running any given program under a user account in Ubuntu. I guess this has very little to do with EC2 in particular.

For example, in windows server 2008, when I:

  1. follow these steps http://support.microsoft.com/kb/315231 to automatically log in a user
  2. add Firefox (or any program) to the windows users' start-up folder
  3. re-bundle the image

Running an instance of the re-bundled image virtually starts Firefox.

How can I accomplish this one simple task in Ubuntu?

And no, you cannot access a windows account that is automatically logged-in via the internet. You would still always need the password to view the user's desktop.

< / NEW >

< OLD >

I have finally created, registered, and ran my first AMI, and it starts up beautifully!

It is a slightly modified version of Eric's 8.04 Hardy w/NX Free Edition found here: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1428&categoryID=208

I have also followed instructions according to the official ubuntu page on enabling automatic login: https://help.ubuntu.com/community/AutoLogin

Along with adding firefox to the list of startup programs; I have firefox set to the official US government's time page so I know exactly what time it starts.

HOWEVER , firefox only starts when I login via my NX client - it doesn't start when I reboot the instance - which leads me to believe the automatic login function on ubuntu is not working.

How can I automatically login to ubuntu's gnome desktop and run firefox on an Amazon EC2 AMI Image? < / OLD >

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Turning off password checking on your EC2 boxes could mean that anyone can login and use them. That can be a problem. For instance, someone could run up a bill on your account.

Also, I don't know why you would want to run 100 instances all running firefox. If you want to automate the collection of web pages, consider looking at wget.

Firefox through X to/from a remote desktop is usually unacceptably slow.

I'm not using NX but you've made me curious about it if you think it is fast enough to support this sort of thing.

There is a way to do this sort of thing without NX; namely, with an X client (like a local ubuntu installation) and ssh with Xwindows forwarding. Perhaps this is similar enough that you can modify it for your needs.

The password requirement can be eliminated through the use of ssh public key authentication instead of turning off passwords on your ec2 boxes.

The ssh command to use is

   ssh -C -Y remoteid@remotehost.com firefox

or just

   ssh -C -Y remoteid@remotehost.com

and then execute whatever command you like from the remote shell.

Explanation:
-Y forward Xwindows from the remote host to the local host in trusting mode
-C compress Xwindows traffic

No Passwords: to do this without passwords in ssh run ssh-keygen, and generate a key pair you keep the private key in your .ssh/id_rsa and you copy the public key to the remote computer and paste it into .ssh/authorized_keys

If you decide you want a password after all, you can add a passphrase to your key if you like, but you only have to do that on the local computer, not the remotes. Or, you can delete the key out of .ssh/authorized_keys and ssh will use password checking instead of key checking when you log in.

share|improve this answer
    
"Turning off password checking on your EC2 boxes could mean that anyone can login and use them. That can be a problem. For instance, someone could run up a bill on your account." If I automatically log a user into a windows bundle on EC2, you cannot simply connect to the windows computer without a password. Not via the internet anyways. Maybe if you were an Amazon employee with a view of all the running users or something.. or am I totally wrong? I have re-iterated the question in bold above, take a look! –  darkAsPitch Feb 16 '10 at 22:40
    
The phrase 'log onto' begs the question 'with what?'. The what and where matter. There can be a terminology conflict or gap, too. You can log onto a Ubuntu box at the console or remotely. Remotely the methods available include telnet, ssh, rdp/vnc, and perhaps NX (I've never used NX). Some of these methods serve text only, some graphics, some both. With Ubuntu you can create a passwordless machine that anyone can log into -- its possible -- but as you say noone should want to. There are also ways to bypass entering the password for a user at the console, or as I showed above, over ssh. –  Paul Feb 16 '10 at 23:06
    
Thanks for your informative input paul, you have been 'thanked' :) I have a more detailed explanation (with better terminology, I hope!) here serverfault.com/questions/113696/… if you could take a look? –  darkAsPitch Feb 17 '10 at 6:48

"Automatic login" only applies to the local display. You do not have a local display.

HOWEVER , firefox only starts when I login via my NX client - it doesn't start when I reboot the instance - which leads me to believe the automatic login function on ubuntu is not working.

Why do you care when firefox starts? What are you actually trying to accomplish?

share|improve this answer

Afaik Autologin means that you don't need to enter a Password or Username when connecting, It does not mean the User is looged in at startup without there being a User, using it. If you would what to do that you need to run it via a start-up script.

As I see it the Autologin actually works perfectly, since as soon as you connect the login is run, and the connection to the NX Server is up while executing the Automatically started programms.

share|improve this answer
    
If there is no user or password, what keeps an intruder from accessing your desktops? –  Paul Feb 16 '10 at 19:18
    
I suppose auto log in is much different on windows than it is on ubuntu, which is causing my problems. On windows, when a user automatically logs in, that account starts running on computer startup. Even inside the cloud, where there is technically no monitor. Take a look above, I have edited the question slightly! –  darkAsPitch Feb 16 '10 at 22:42
    
The easiest would be to write a Init script which launches X and Firefox, place it in the /etc/init.d/ and add it to the default runlevel. At least this would be my way to do it, but I gotta admit I haven't been working with other things than shell lately. –  Sideshowcoder Feb 17 '10 at 8:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.