Sudo in Ubuntu

Here’s a low down of using sudo in Ubuntu and its derivatives, courtesy of Linux Journal. Below is the best comment (courtesy of Martin Thomas) that captures the main idea of sudo in Ubuntu.

The only thing that Ubuntu added is that the sudoers file is preconfigured to include the primary user, saving the whole rigmarole of becoming root, editing the file etc.

Other than that, there is no difference, style or otherwise, between sudo on Ubuntu or on any other platform (Debian, Solaris, BSD, Linux etc).

Related Links:

RootSudo

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 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. This means that you cannot login as root directly or use the su command to become the root user. However, since the root account physically exists it is still possible to run programs with root-level privileges. This is where sudo comes in – it allows authorized users (normally “Administrative” users; for further information please refer to AddUsersHowto) to run certain programs as root without having to know the root password.

This means that in the terminal you should use sudo for commands that require root privileges; simply prepend sudo to all the commands you would normally run as root. For more extensive usage examples, please see below. Similarly, when you run GUI programs that require root privileges (e.g. the network configuration applet), use graphical sudo and you will also be prompted for a password (more below). Just remember, when sudo asks for a password, it needs YOUR USER password, and not the root account password.

Ubuntux

By default the root user is setup with a random hash during the install of Ubuntu (zoopster).

There’s absolutely nothing wrong with changing the root password. The only danger is in forgetting the password (steve)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s