Search This Blog

Labels

adobe (1) android (3) apache (3) aviation (1) bash (2) chrome (2) composer (1) cookery (3) dev (2) dodanperks (1) extensions (1) facebook (2) firefox (1) git (2) grafana (1) guzzle (1) headaches (11) htaccess (1) html5 (2) jquery (2) lamp (1) life hacks (10) linux (28) mysqli (2) native (1) opera (2) php (10) railfanning (1) reactjs (3) reactnative (1) servers (11) sinhala (1) smartphones (2) snap (1) sound (1) tech (22) troubleshoots (4) ubuntu (29) unicode (4) virtualbox (1) wamp (2) web (11) windows (4) wordpress (3) youtube (2) කෑම (3)

Tuesday, 23 September 2014

Ubuntu: How to create a new user

Command-line

To add a user you must use the sudo command (for an explanation of what that means, see the RootSudo page). Here are the commands:
To add a user. NOTE: do not use the useradd command.
$ sudo adduser <username>
To see the options for adding a user try the man command.
$ man adduser
Here is a useful example of the useradd command. Why use useradd? It gives a few more options for special cases. To add a user, give her a standard home directory in the /home folder and specify the shell she accesses by default do this:
$ sudo useradd username -m -s /bin/bash 
$ sudo passwd username 

Groups

You might also wish to create a new group for your users.
# sudo addgroup <groupname>
To add a new user to a existing group you would do this:
# sudo adduser <username> audio
To add an existing user to an existing group you can use the same command:
# sudo adduser <username> <groupname>
or
# sudo usermod -aG <groupname> <username>


Extracted from UbuntuHowTo

No comments:

Post a Comment