====== Adding a User ====== If you are doing this as root, don't use the 'sudo' command. To add a user to the system: - Issue the useradd command to create a locked user account: sudo useradd - Unlock the account by issuing the passwd command to assign a password and set password aging guidelines: sudo passwd If you get the following error: bash: useradd: command not found Try sudo /sbin/useradd Or sudo /usr/sbin/useradd ===== Examples ===== See what groups the user is in:
''id -nG {user-name}''
Add user and specify home directory while adding to groups:
''sudo useradd -d /home/testuser -m testuser -G adm,dialout,cdrom,plugdev,lpadmin,sambashare,admin''
Add user to a group:
''sudo useradd -a -G admin testuser''
To modify (or remove from) group membership, just specify explicitly:
''sudo useradd -G adm,dialout,cdrom,plugdev testuser''
===== References ===== * [[http://www.cyberciti.biz/faq/howto-linux-remove-user-from-group/|http://www.cyberciti.biz/faq/howto-linux-remove-user-from-group/]] * [[http://www.ubuntuka.com/add-user-to-existing-group-ubuntu/|http://www.ubuntuka.com/add-user-to-existing-group-ubuntu/]] * [[http://www.howtogeek.com/howto/ubuntu/add-a-user-on-ubuntu-server/|http://www.howtogeek.com/howto/ubuntu/add-a-user-on-ubuntu-server/]] -- Main.FredPettis - 02 Jun 2009