This is an old revision of the document!
In Linux (and Unix in general), there is a SuperUser named Root. The Windows equivalent of Root is Administrators group. The SuperUser can do anything and everything, and thus doing daily work as the SuperUser can be dangerous. You could type a command incorrectly and destroy the system.
Ideally, you should run as a user that has only the privileges needed for the task at hand. In some cases, this is necessarily Root, but most of the time it is a regular user.
By default, the Root account password is locked in Ubuntu, and therefore Vinux. This means that you cannot login as Root directly or use the su command to become the Root user.
Please keep in mind, a substantial number of Vinux users are new to Linux. There is a learning curve associated with any OS and many new users try to take shortcuts by enabling the root account, logging in as root, and changing ownership of system files.
Although for desktops the benefits of using sudo are great, there are possible issues which need to be noted:
Alternatively, a sysadmin type account can be implemented as a local user on all systems, and granted proper sudo privileges. As explained in the benefits section above, commands can be easily tracked and audited.
When using sudo, your password is stored by default for 15 minutes. After that time, you will need to enter your password again.
Your password will not be shown on the screen as you type it, not even as a row of stars. It is being entered with each keystroke!
To use sudo on the command line, preface the command with sudo, as below: Example #1
sudo chown bob:bob /home/bob/*
sudo /etc/init.d/networking restart
To repeat the last command entered, except with sudo prepended to it, run:
You should never use normal sudo to start graphical applications as Root. You should use gksudo to run such programs. gksudo sets HOME=~root, and copies .Xauthority to a tmp directory. This prevents files in your home directory becoming owned by Root. (AFAICT, this is all that's special about the environment of the started process with gksudo vs. sudo).
gksudo gedit /etc/fstab
In Ubuntu and thus Vinux pretty much anything that a typical user will want or need to do is posible using sudo to gain admin privilidges. This is what is needed on a single user system, but perhaps you share a computer with a co-worker or family member. You can create an account for them and control what they can and can't do according with the confidence you have in them and their abilities. For example you may want your to give your kid the capability to read any file on the computer, but not allow modifications, or let her/him install or remove system software. You may run some command frequently, perhaps via an alias to save on typing, that has little or no chance of doing anything to harm your system or data and not want to be prompted for you password to run it. Or you may wish to change the frequency of password prompts. While advanced sys-admin tasks are not the focus of this wiki a bit of sudo configuration can help even less experienced Linux users. The main way to configure sudo behavior is editing a sudoers file. While for more complex systems creating per user sudoers files is generally recommended, it is probably more common to modify /etc/sudoers for less complex situations. Very Important: You can break essential functionality by incorrectly modifying sudoers files, so although you can use normal editing methods to change sudo configuration there is a special tool called visudo that checks for improper syntax before sudoers changes are saved.
The visudo tool checks for syntax erros before saving changes to sudoers files. It works with standard text editors. I think the "vi" in "visudo" stands for the VI text editor, but visudo works with the editor of your choice, by default the system's default editor is used. To change the editor you use with visudo run a command like
sudo export EDITOR=ed
to use ed as the default editor for the life of the session in the active terminal or console. Replace ed with another editor if desired,
sudo export EDITOR=nano