Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i am trying to add groups and users using command line , addgroup/groupadd/usradd/, but i am getting commands can not be found. i think i am missing some "group/user command line tools" that need to be installed so i could use those command from the terminal .
does anyone come accross something like that? what tools or packages am i missing that need to be installed?
The most likely problem is that the commands are not in your path (when logged in as root), and bash doesn't know where to find the commands. To determine if the commands are indeed installed, open a terminal and issue these commands;
Bash will probably return something like: /usr/sbin/useradd and /usr/sbin/groupadd.
Since bash doesn't recognize the commands, then /usr/sbin is probably not in your path.
You can run the commands by giving the full path when you try to run the commands:
/usr/sbin/useradd and /usr/sbin/groupadd.
To permanently add /usr/sbin to your path, edit the file /etc/ld.so.conf, and add /usr/sbin, and save the file. Then run /sbin/ldconf to update your path configuration.
There is also a bash PATH and export PATH option to update, but I don't remember how it works.
thanks for the reply
i did what u said and found /usr/sbin/useradd and /usr/sbin/groupadd
now these are super user command when i add them as u explained to my both would that be security issue since regular users would be able to run the command too?
just a newbe question..
It's more the fact that the password and group files and only writeable by the root user, so when a normal user tries to run useradd, it'll go fine until it actually tries to modify the password or group file, and then konk out with an error. Users generally can run the programs in the sbin directories, but can't use them to modify the system set up because of the permission checks in the system (of course, all this goes out the window if stuff is misconfigured, like if /etc/passwd is world writeable or somesuch).