Sudo Problem?

Hi I wanted to add a group using 1 id which is not root but has some sudo privileges.

test@test>sudo -l 
gives this
(root) NOPASSWD: /usr/bin/passwd, /usr/sbin/useradd, /usr/sbin/usermod, /usr/sbin/userdel, /usr/bin/tee, /usr/bin/grep, /bin/grep, /usr/bin/chmod, /bin/chmod, /usr/bin/echo, /bin/echo, /usr/bin/cat, /bin/cat, /usr/bin/logins, /usr/bin/ls, /bin/ls, /usr/bin/faillog, /usr/bin/chage, /usr/bin/groups, /usr/bin/ed, /bin/ed, /usr/sbin/groupadd, /usr/sbin/groupmod, /usr/sbin/groupdel, /usr/bin/rm, /bin/rm, /usr/bin/mv, /bin/mv, /usr/bin/sed, /bin/sed, /usr/bin/touch, /bin/touch, /usr/bin/cp, /bin/cp, /usr/bin/awk, /bin/awk, /usr/bin/cut, /bin/cut, /usr/bin/gpasswd, /bin/gpasswd, /usr/sbin/faillog
test@test> cd /usr/sbin
test@test> sudo groupadd testgrp
test's password:<enter>
test@test> cat /etc/group

Group Not Added

test@test> sudo groupadd testgrp
test's password:<test's passwd>
sudo: groupadd: command not found

What Am I doing wrong over here?

Thanks in advance

do a "which groupadd" maybe since it is in /usr/sbin/ and not part of a normal user's path, you need to invoke it with the full PATH? :slight_smile:

Also, since . is not in the PATH (And it should not be) you should try ./groupadd when running in the /usr/sbin/ directory.