I installed CentOS 5.5 on my VMWare 8 recently and I am trying to add a new user on the system. I am unable to add the user unless I use su - option. I believe it has to do something with path not set properly.

I updated the path and here is what it looks like /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/uone/bin:/sbin

I believe the command is in /sbin dir which is already a part of path. Can anyone suggest me what else I might be missing?


Try adding /usr/sbin to your path.

  • Yep! That did the trick, Added it as priority location in path. Thanks mdpc :) – Atul Aug 3 '14 at 6:54
  • 1
    How would I do that? There is already a PATH = something in my .bash_profile? How do i add another one? – xiaodai Dec 17 '14 at 7:05
  • @xiaodai unix.stackexchange.com/a/26059/24354 – Hartley Brody Oct 20 '15 at 18:41
  • Want to provide an example of that for this to be a complete answer? – Henry F Feb 28 '17 at 4:01

I know the OP answer was solved, however for those who are running CentOS from within the docker container, which appears to be missing both adduser and useradd, the solution is to install shadow-utils (under root obviously):

yum install shadow-utils
/usr/sbin/useradd username -g groupname -d homedirectory
  • Its giving me error -bash: /usr/sbin/useradd: No such file or directory – Nishad Up Feb 20 '18 at 7:51
whereis useradd

this is used to solve that problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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