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 newuserYou 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:ALLThat tip is from here.
3