|
1.
User Administration
Adding a User for Daily Use
Working as root on a Unix/Linux system is dangerous and should be avoided
as much as possible. Therefore it is strongly recommended to add a user
for day-to-day use.
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:
| Group |
Description |
| audio |
be able to access the audio devices |
| cdrom |
be able to directly access optical devices |
| floppy |
be able to directly access floppy devices |
| games |
be able to play games |
| portage |
be able to use emerge --pretend as a normal user |
| usb |
be able to access USB devices |
| plugdev |
Be able to mount and use pluggable devices such as cameras and USB sticks
|
| video |
be able to access video capturing hardware and doing hardware
acceleration
|
| wheel |
be able to use su
|
For instance, to create a user called john who is member of the
wheel, users and audio groups, log in as root first
(only root can create users) and run useradd:
Code Listing 1.1: Adding a user for day-to-day use |
Login: root
Password:
# useradd -m -G users,wheel,audio -s /bin/bash john
# passwd john
Password:
Re-enter password:
|
If a user ever needs to perform some task as root, they can use su -
to temporarily receive root privileges. Another way is to use the sudo
package which is, if correctly configured, very secure.
1.
Optional: Install GRP Packages
Important:
This part is for GRP users only. Other users should skip this part and continue
with (Where to go from here?).
|
Now that your system is booted, log on as the user you created (for instance,
john) and use su - to gain root privileges:
Code Listing 1.1: Gaining root privileges |
$ su -
Password:
|
Now we need to change the Portage configuration to look for the prebuilt
binaries from the second CD (Gentoo Packages CD). First mount this CD:
Code Listing 1.1: Mount the Packages CD |
# mount /mnt/cdrom
|
Now configure Portage to use /mnt/cdrom for its prebuilt packages:
Code Listing 1.1: Configuring Portage to use /mnt/cdrom |
# ls /mnt/cdrom
# export PKGDIR="/mnt/cdrom/packages"
# export PKGDIR="/mnt/cdrom"
|
Now install the packages you want. The Packages CD contains several prebuilt
binaries, for instance KDE and GNOME.
Code Listing 1.1: Installing GNOME |
# emerge --usepkg gnome
|
To find out what prebuilt packages are available, do a quick listing of all
the files in /mnt/cdrom/All. For instance, to find out if KDE is
emergeable:
Code Listing 1.1: Finding out if KDE is installable |
# ls /mnt/cdrom/All/kde*
|
Be sure to install the binaries now. When you do an emerge --sync to
update Portage (as you will learn later), the prebuilt binaries might not match
against the ebuilds in your updated Portage. You can try to circumvent this by
using emerge --usepkgonly instead of emerge --usepkg.
Congratulations, your system is now fully equipped! Continue with (Where to go from here?) to learn more about
Gentoo.
|