The Computer Oracle

Amazon EC2 prompt password when sudo

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Thinking It Over

--

Chapters
00:00 Amazon Ec2 Prompt Password When Sudo
00:24 Accepted Answer Score 11
00:52 Thank you

--

Full question
https://superuser.com/questions/783939/a...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#amazonec2

#avk47



ACCEPTED ANSWER

Score 11


Warning: Make sure to set the password for ec2-user before doing this

You need to modify the sudo settings to enable password authentication when using sudo. Run the visudo command as root (or sudo visudo) and look for a line like this:

ec2-user        ALL=(ALL)       NOPASSWD: ALL

Remove the NOPASSWD: bit, so the line looks like this:

ec2-user        ALL=(ALL)       ALL

sudo will ask for a password next time you log on. Again, make sure to set your password before doing this!