Advanced

Learn the Linux command line

Posted by Scott_Ruecker on · 4 comments
Tectonic.co.za
Mail this story
Print this story

Eight must-know Linux commands that will turn any Linux novice into an apparent command line guru. Go on. Impress your friends and family.

Full Story

  Nav
» Read more about: Groups: Linux; Story Type: News Story

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (4)

To use sudo do this:

sudo command you want to execute

You will be prompted for a password. You don't need the root password. Just type in your password and the command will be executed as root. Once the command is done you will be returned to your own login.

on my Mandriva system I get the following message

$ sudo drakconf $ tracy is not in the sudoers file. This incident will be reported
>You don't need the root password.

That depends on your configuration and your id. In Suse, for example, ordinary users must still provide the root password to use sudo to execute as root. In Ubuntu, I believe it is the same, except that users identified as having administrative authority (which, by default, includes the first user you set up) may gain root via their own password.

**Edit** That is the DEFAULT SuSE behavior. You can, of course, add users to /etc/sudoers.
That's normal behavior on most systems. The default configuration for sudo is that root has to add each user she wants to grant sudo access to the /etc/sudoers file, and specify what programs that user is allowed to run.

My man page for sudo indicates that the default is now to expect the user's password, not root's, but I don't believe that used to be the case.
For completeness sake, here's the conf-line that matters:

Quoting:Defaults rootpw


If that line is in /etc/sudoers, you need the root pw to sudo. If it's not in /etc/sudoers, or it's commented out, you need the password of the user you are logged in with at that moment.

You can also enable a user to do some stuff without a passwd:
Quoting: Cmnd_Alias BACKUP = /usr/bin/flexbackup, /home/kwint/bin/flexbu .... ....

kwint ALL = NOPASSWD: BACKUP


This means that user 'kwint' may do, on ALL hosts (that's only 'localhost' in this case, my own PC), without a passwd, the actions that are in the Cmnd_Alias 'group' BACKUP. It is nice to make Cmnd_Aliases to group commands which are almost the same.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post