Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Have an EC2 instance. Connect via ssh. Can navigate through directories.

When I try to use a sudo command, I am prompted for a password.

ubuntu@ec2-ip-address:/etc$ sudo su root
[sudo] password for ubuntu:

I haven't ever set a password. That is what SSH is for. How do I change to the root user?

share|improve this question

migrated from serverfault.com Oct 20 '12 at 19:15

This question came from our site for professional system and network administrators.

1 Answer 1

up vote 3 down vote accepted

You need to do any of:

  • set a password for your user
  • set a password for root and use su
  • change the sudoers file to allow passwordless sudo
share|improve this answer
    
1) change sudoers file - can't access, permission denied; can't chmod because a password is required. 2) how can I set a password for user or root? –  Christopher Ickes Oct 19 '12 at 19:34
1  
Presumably you're using an AMI provided by Amazon? It should have a default password for that user. –  MikeyB Oct 19 '12 at 19:38
    
Sorry still struggling... According to a few articles, the Amazon Ubuntu AMIs don't have passwords for user ubuntu -> superuser.com/questions/456885/… –  Christopher Ickes Oct 19 '12 at 19:45
1  
@ChristopherIckes This would be a question for the folks who provided the AMI. You must have either a root password (usable with su) or a user password (usable with sudo) in order to switch to root... –  voretaq7 Oct 19 '12 at 21:18
    
The AMI was errantly switched from an Amazon AMI to a 3rd party. Switched back to Amazon AMI and issue is solved. –  Christopher Ickes Oct 22 '12 at 0:40

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.