Had an interesting time figuring out how user and group management works from the command line on my QNAP server. At first the usual Linux commands do not seem to exist:
useradd usermod userdel groupadd groupmod groupdel
After some Google research (who’s your friend?) I found some forum posts that pointed out the commands have been replaced by QNAP’s own special versions:
useradd > adduser usermod > ? userdel > deluser groupadd > addgroup groupmod > ? groupdel > delggroup
Take note that the options in some cases do not match the original Linux commands. Just run the command without any options and it will list the options. After examining the users that the commands create, I think the reason QNAP has replaced the original Linus commands is enforce some QNAP specific behavior like adding a user to the group everyone by default.
On a side note: the commands adduser, deluser, delgroup seem to be Debian specific. The other commands are the universal command, which you would expect to be supported by any Linux version. Or am I wrong?
All the user account and group information does seem to be stored in the usual files:
/etc/passwd - User account information /etc/shadow - Secure user account information /etc/group - Group information
After some more digging I discovered that the commands do exist, but have been hidden away from us mortals:
useradd > /usr/local/bin/useradd usermod > /usr/local/bin/usermod userdel > usr/local/bin/userdel
Do you need to check which groups a user is a member of? Try the following command:
id <username>
I hope this helps some one and saves them some time searching the matrix 🙂 If anyone knows where or what the command is for groupmod, please let me know.
Nice one. Very helpful
Great!
That was what I’m looking for… Thank YOU!
Maik