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

Hey guys, I am very new to linux, and amazon-ec2. I wanted to put a quick server. For some reason, when I sign in with my key pair, it prompts me for a username, I input ec2-user, and I'm in. The problem is that I don't have root access (and can't find the root password). I need to install screen to run the server in the background, and also create a new user, that doesn't have root, to run the server. Neither of which I can do without root.. Any help?

Edit: I am using Basic 32-bit Amazon Linux AMI 2010.11.1 Beta as the 'AMI'.

Thanks, Max

share|improve this question

3 Answers 3

up vote 2 down vote accepted

The Amazon Linux AMI User Guide explains that you can use sudo to run commands as root e.g. sudo whoami:

http://ec2-downloads.s3.amazonaws.com/AmazonLinuxAMIUserGuide.pdf

How do I get root SSH access on my Amazon Linux AMI instance?

The Amazon Linux AMI does not allow remote root SSH by default. You should specify a keypair at instance launch and login as ‘ec2‐user’ using your keypair to access the command line. This user has sudo access by default to allow you to run root actions. If you wish to enable remote root login, please be aware that it is significantly less secure than relying on keypairs and a secondary user.

share|improve this answer
2  
Thanks! I hadn't found that haha sudo su - works. –  mazzzzz Feb 5 '11 at 22:13

It depends on the Linux image you're running, but generally you can sudo from the initial login user account to gain root privileges.

share|improve this answer
    
Forgot that bit, edited above post –  mazzzzz Feb 5 '11 at 21:20

Has worked for me connecting to ssh -i jose.pem root@ec2-46-137-38-52.eu-west-1.compute.amazonaws.com

share|improve this answer
    
This really barely qualifies as an answer, if it even does. –  HopelessN00b Oct 22 '12 at 16:24

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.