Where is the password for newly created EC2 user?

I created a newuser on EC2 following this document AWS doc. Now I can use this user to SSH to the EC2 instance. The only issue is that every time when I need to use sudo (for example, when I do sudo yum update), it asks for password:

[sudo] password for newuser:

I created a password for newuser but this password does not work.

1 Answer

The procedure given in the article you linked does not have you set a password, so there is no password.

To set a password, login as a user that is allowed to sudo and run:

sudo passwd newuser

You will have to enter the password for newuser twice and then it should be set.


sudo

If you want newuser to be allowed to sudo, then you'll have to also edit /etc/sudoers to add a line such as:

# User privilege specification
newuser ALL=(ALL) NOPASSWD:ALL

That tip is from here.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like