Jadu Gar:
In Linux, I havent set the password of my ec2-user, but as you know it has sudo authority. But i am facing this error and cant find how to rectify it.We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Alistair Mackay:
This is not an error. It is a standard message printed by sudo
that warns an user of their responsibility if they proceed to assume superuser rights.
Jadu Gar:
but it asks for the password, which i havent set, so in that what should i enter as password. I have tried admin, root but all its says incorrect password
Alistair Mackay:
sudo
asks for the password of the user who runs sudo
, therefore it’s the password of ec2-user
.
Assuming you logged in as ec2-user with a key pair, the you should be able to create a password for ec2-user simply by running the passwd
command. Then use that password with sudo
If this ec2 is running something important, deploy another instance just to test the above works.
Alistair Mackay:
Having said that, by default on a freshly deployed EC2 instance, the ec2-user
should have password-less sudo
access. Is this a machine that has been deployed by an infrastructure team in your company? They may have hardened it to prevent all and sundry from having unfettered root access. If that’s the case, you should speak to the concerned team.