Is there a good way to give ec2-user admin credentials on EC2? I'm sudoing too often

1

0

Disclaimer: I'm only decent with EC2 and Unix commands / Linux administration.

Question: How do you give ec2-user the same permissions as root? I'm tired of sudoing.

Why?

I found out that you have to log in to EC2 as "ec2-user". OK, that's fine, except ec2-user doesn't have permissions for a lot of stuff, so I'm always sudoing to install stuff.

I also "su root" after giving root a password with pwd.

There's got to be a better way.

Dave

Posted 2011-10-29T17:25:13.010

Reputation: 257

Personally, I find the requirement to use sudo to be a feature, not a bug. It's a reminder that the command you're executing can affect the system rather than just stuff in your own account. (Admittedly the distinction is a bit vague if you're the only use on the system.) – Keith Thompson – 2011-10-29T22:18:41.873

I think it's a feature too, I'm just not knowledgeable enough at the moment to know when I should be root to install something, vs when I can install it from ec2-user. So I'll just install everything as root...? – Dave – 2011-10-29T22:31:52.950

My general rule is, anything you can do as a non-root user, you should do as a non-root user. Installing software packages usually requires root, since you need to modify system directories (unless you're installing under your home directory, but on EC2 you probably wouldn't do that anyway). And running an interactive root shell can be an invitation to trouble. – Keith Thompson – 2011-10-29T22:35:30.467

Answers

2

You can switch to the root user using:

sudo -i

You don't need to set a password on the root account.

Eric Hammond

Posted 2011-10-29T17:25:13.010

Reputation: 286