User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

addingauser [2013/01/27 21:29] (current)
Line 1: Line 1:
 +====== 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:
 +      <​file>​sudo useradd <​username></​file>​
 +  - Unlock the account by issuing the passwd command to assign a password and set password aging guidelines:
 +      <​file>​sudo passwd <​username></​file>​
 +If you get the following error:
 +<​file>​bash:​ useradd: command not found</​file>​
 +<​file>​sudo /​sbin/​useradd <​username></​file>​
 +<​file>​sudo /​usr/​sbin/​useradd <​username></​file>​
 +===== Examples =====
 +See what groups the user is in:<br />
 +''​id -nG {user-name}''​ <br />
 +Add user and specify home directory while adding to groups:<​br />
 +''​sudo useradd -d /​home/​testuser -m testuser -G adm,​dialout,​cdrom,​plugdev,​lpadmin,​sambashare,​admin''​ <br />
 +Add user to a group: <br />
 +''​sudo useradd -a -G admin testuser''​ <br />
 +To modify (or remove from) group membership, just specify explicitly: <br />
 +''​sudo useradd -G adm,​dialout,​cdrom,​plugdev testuser''​ <br />
 +===== References =====
 +  * [[http://​​faq/​howto-linux-remove-user-from-group/​|http://​​faq/​howto-linux-remove-user-from-group/​]]
 +  * [[http://​​add-user-to-existing-group-ubuntu/​|http://​​add-user-to-existing-group-ubuntu/​]]
 +  * [[http://​​howto/​ubuntu/​add-a-user-on-ubuntu-server/​|http://​​howto/​ubuntu/​add-a-user-on-ubuntu-server/​]]
 +-- Main.FredPettis - 02 Jun 2009
addingauser.txt ยท Last modified: 2013/01/27 21:29 (external edit)