Difference between revisions of "En:Managing Users"

From Sabayon Wiki
Jump to: navigation, search
(Added i18n template and Codeboxes.)
(Added Group management)
Line 1: Line 1:
 
{{I18n| [[De:Managing_Users|de]] [[En:Managing_Users|en]]}}
 
{{I18n| [[De:Managing_Users|de]] [[En:Managing_Users|en]]}}
  
== Procedure to create a new user ==
+
== User Management ==
 +
 
 +
=== Procedure to create a new user ===
  
 
Open a terminal and login as root. Then enter the following commands:
 
Open a terminal and login as root. Then enter the following commands:
Line 18: Line 20:
 
</pre>}}
 
</pre>}}
  
== Procedure to delete a user (Use with '''Caution!''') ==
+
=== Procedure to delete a user (Use with '''Caution!''') ===
  
 
Open a terminal and login as root. Then enter the following command:
 
Open a terminal and login as root. Then enter the following command:
Line 26: Line 28:
 
For more information:  
 
For more information:  
 
{{Console|<pre class="clear"># man userdel</pre>}}
 
{{Console|<pre class="clear"># man userdel</pre>}}
 +
 +
== Group Management ==
 +
 +
You can find all groups in /etc/group - syntax is
 +
group_name:password:group_id:users_in_this_group
 +
whereby ''x'' indicates, that there is no password set and ''users_in_this_group'' is a comma separated list.
 +
 +
Each line lists a group. group_id 0 is always root. Numbers in range 1-999 lists services and then follow users.
 +
 +
=== Create a new group ===
 +
 +
{{Console|<pre class="clear"># groupadd groupname</pre>}}
 +
 +
Creates ''groupname''.
 +
 +
=== Add a user to an existing group ===
 +
 +
{{Console|<pre class="clear"># usermod -a -G groupname username</pre>}}
 +
 +
Adds ''username'' to ''groupname''.
 +
 +
=== Delete a group ===
 +
 +
{{Console|<pre class="clear"># groupdel groupname</pre>}}
 +
 +
Removes ''groupname''.

Revision as of 19:49, 12 April 2013

i18n: de en

User Management

Procedure to create a new user

Open a terminal and login as root. Then enter the following commands:

# useradd -G audio, cdrom, video, games, cdrw, users, netdev, entropy, portage, plugdev, pulse -m new_user_name
# passwd new_user_name
  • where the option -G show all groups of the new user,
  • with the -m option creates the /home/new_user_name.
  • and the second line introduce the password for the new user.

For more information:

# man useradd 
# man passwd

Procedure to delete a user (Use with Caution!)

Open a terminal and login as root. Then enter the following command:

# userdel -r user_name

to delete the user user_name and his/her home directory (option -r).

For more information:

# man userdel

Group Management

You can find all groups in /etc/group - syntax is

group_name:password:group_id:users_in_this_group

whereby x indicates, that there is no password set and users_in_this_group is a comma separated list.

Each line lists a group. group_id 0 is always root. Numbers in range 1-999 lists services and then follow users.

Create a new group

# groupadd groupname

Creates groupname.

Add a user to an existing group

# usermod -a -G groupname username

Adds username to groupname.

Delete a group

# groupdel groupname

Removes groupname.