Quote Originally Posted by oscar
when you write "sudo" you are in the "root"
There are two seperate issues here. There is the user 'root' who has ultimate authority. It is possible to execute commands as root without actually becoming root. Example:

sudo mcedit /etc/X11/XF86Config-4

That is translated as:
sudo- do as if root
mcedit- use Midnight Commander to edit
/etc/X11/- path to the file you wish to edit
XF86Config-4- name of the file to edit

Why would you wish to be root when you edit that file? If you want to save anything you edit in that file you must be root (assuming you have not changed the default settings). If you only wish to view the file you would not open it as root but a normal user, this way you cannot inadvertently corrupt the file.

This is how to become root:

su
<password>

Now anything that you do in this terminal will be done as root. Yes you can edit and save files. Yes you can cause quite a few problems. Under no circumstances is it advisable to surf the web as the root user. If you open another terminal window you are not root in that new terminal until you become root.

In order to use the 'sudo' command you must make yourself part of the 'sudoers group'. How?
su
<password>
xedit /etc/sudoers (you can use whatever editor you like of course)


#sudoers file
# See the man page for details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL
your_user_name ALL=(ALL) ALL<--add a line like this with your user name
#knoppix ALL=NOPASSWD: ALL

After you edit the file don't forget to save it. Now you should be able to execute a command as root without actually becoming root.

Some programs must be executed as root:

sudo cfdisk /dev/hda

There is also a directory named 'root that you could work "in"'. It is identified simply with a forward slash /. The root 'user' and root 'directory' are two entirely different things.