Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running Centos 5.3 and I can su to root fine. However when I run a command as another user like: sudo ls, the system says incorrect password for the same password. Why is this happening?

Thanks.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

If you execute

su command

you have to enter the root user's password.

However, if you execute

sudo command

you have to enter your own password.

The purpose of sudo is precisely being able to execute commands as root (or another user) without knowing his password.

See:

share|improve this answer
add comment

When you use "su" you use ROOTS password, but when you use sudo you should use the users password. "su" is used to "become" another user and gain their privileges, "sudo" is used to run a command as another user, ie lets you use your privileges to do something as them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.