Adding Users Or Groups

Hanging With The Group

Adding a user to the system is pretty basic stuff. Just run the adduser command as root with the user name.

adduser obama

The user will be added to the system and his home dir created.

To remove a user from the system, run the deluser command as root with the user name.

deluser obama

The user will be removed from the system. To delete his home directory add --remove-home option.

To remove all user files and home dir in one hit, add --remove-all-files option. This will remove all mail files also.

To add a user to a group, run the adduser command with user and group name. Use no options:

adduser obama cdrom

Adds user obama to the group cdrom.

To remove a user from a group run deluser command with no options:

deluser obama cdrom

Removes user obama from the group cdrom.

To add a new group to the system run the addgroup command as root.

addgroup funky

To delete a group from the system run the delgroup command as root.

delgroup funky

There are another set of commands for adding users and groups:

useradd / groupadd

They operate a little different to adduser addgroup.

Check out the man page for more info.

That's about it!