<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">

<!-- The content of this document is licensed under the CC-BY-SA license -->
<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->

<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-finalise.xml,v 1.43 2006/01/23 14:33:40 neysx Exp $ -->

<sections>

<version>2.2</version>
<date>2006-01-23</date>

<section>
<title>User Administration</title>
<subsection>
<title>Adding a User for Daily Use</title>
<body>

<p>
Working as root on a Unix/Linux system is <e>dangerous</e> and should be avoided
as much as possible. Therefore it is <e>strongly</e> recommended to add a user 
for day-to-day use.
</p>

<p>
The groups the user is member of define what activities the user can perform.
The following table lists a number of important groups you might wish to use:
</p>

<table>
<tr>
  <th>Group</th>
  <th>Description</th>
</tr>
<tr>
  <ti>audio</ti>
  <ti>be able to access the audio devices</ti>
</tr>
<tr>
  <ti>cdrom</ti>
  <ti>be able to directly access optical devices</ti>
</tr>
<tr>
  <ti>floppy</ti>
  <ti>be able to directly access floppy devices</ti>
</tr>
<tr>
  <ti>games</ti>
  <ti>be able to play games</ti>
</tr>
<tr>
  <ti>portage</ti>
  <ti>be able to use <c>emerge --pretend</c> as a normal user</ti>
</tr>
<tr>
  <ti>usb</ti>
  <ti>be able to access USB devices</ti>
</tr>
<tr>
  <ti>plugdev</ti>
  <ti>
    Be able to mount and use pluggable devices such as cameras and USB sticks
  </ti>
</tr>
<tr>
  <ti>video</ti>
  <ti>
    be able to access video capturing hardware and doing hardware
    acceleration
  </ti>
</tr>
<tr>
  <ti>wheel</ti>
  <ti>be able to use <c>su</c></ti>
</tr>
</table>

<p>
For instance, to create a user called <c>john</c> who is member of the
<c>wheel</c>, <c>users</c> and <c>audio</c> groups, log in as root first 
(only root can create users) and run <c>useradd</c>:
</p>

<pre caption="Adding a user for day-to-day use">
Login: <i>root</i>
Password: <comment>(Your root password)</comment>

# <i>useradd -m -G users,wheel,audio -s /bin/bash john</i>
# <i>passwd john</i>
Password: <comment>(Enter the password for john)</comment>
Re-enter password: <comment>(Re-enter the password to verify)</comment>
</pre>

<p>
If a user ever needs to perform some task as root, they can use <c>su -</c>
to temporarily receive root privileges. Another way is to use the <c>sudo</c> 
package which is, if correctly configured, very secure.
</p>

</body>
</subsection>
</section>
</sections>
