Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
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.


share|improve this answer

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .