14

Cannot create a group in RHEL5. I get error groupadd: command not found.

jww
  • 11,918
  • 44
  • 119
  • 208

3 Answers3

22

It seems that groupadd is the correct command: RHEL5 admin. addgroup is a debian specific commnad.

Are you logged in as root? groupadd is in /usr/sbin which, by default, is not in the path. run echo $PATH and see if /usr/sbin is there. Not that running it as non-root is very helpful: you require root access to add a group.

0

USING CENTOS 5.9

Make sure you have installed a FQDN (full qualified domain name), for example Centosbox.local. Then execute the following command as a user with sudo privileges:

sudo gedit /etc/sysconfig/network

Change the value of HOSTNAME from "whatever.unknown" to "whatever.local".

Reboot and enjoy using groupadd.

0

A common reason for not finding the groupadd command is that you are trying to access it as a user that does not have read access to the program, which is typically found in /usr/sbin/groupadd. You will need to assume the root user's identity, either with su or sudo or logging in as root, and then you should find the command.

I'm using Cent OS 7 and I see that the program's permissions do not allow others to read it:

#>ls -l /usr/sbin/groupadd
-rwxr-x---. 1 root root 61336 Mar  6  2015 /usr/sbin/groupadd

As you can see, no permissions are set for others, which explains why querying the program as a user other than root results in not finding it.