29

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?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Atul
  • 1,891

4 Answers4

41

Try adding /usr/sbin to your path.

For example to add it to the end of the path you would do something like this:

export PATH=$PATH:/the/file/path

mdpc
  • 6,834
23

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
vermin
  • 231
8
/usr/sbin/useradd username -g groupname -d homedirectory
don_crissti
  • 82,805
user60679
  • 185
-3
whereis useradd

this is used to solve that problem

Hauke Laging
  • 90,279