Difference in passwd and sudo passwd?

I wanted to know what happens when i run passwd command with sudo. I get a prompt to enter new UNIX password? Which user password is being changed here?

1 Answer

sudo will cause the console authenticate yourself with your current user. Once done, passwd command will be issued, so once you successfully authenticated, root's password is the one being changed.

If you just run passwd without sudo, the current user's password is being changed.

1

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