Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 working on CentOS 5.5.

When I run the useradd command as root, then its working.

But when I run the same command from one of the user, then it shows

-bash: /usr/sbin/useradd: Permission denied

Why all this happening?

I also added /usr/sbin in PATH.

I added user from root by following commands:

groupadd service
useradd -g service service
passwd service

I installed Operating System two three times, all the time it shows same error.

Help me please, I didn't understand why all this happening.

share|improve this question
It would be better if you could split your question in 2. One question regarding useradd and one regarding vim. – Huygens Mar 15 '13 at 10:11
@Huygens ohk I will do that. – devsda Mar 15 '13 at 10:18

The command useradd needs some special privilege to modify the system settings. Hence, you get a permission denied when using it as a normal user.

To be able to call useradd from a normal user, you need to configure sudo. It is not too complicated, see this tutorial: http://quaid.fedorapeople.org/sudo-tutorial/ especially chapter 4.

share|improve this answer

Your Answer


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.