Difference Between su and sudo and How to Configure sudo in Linux

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

23 Responses

  1. Laxma Reddy says:

    Hi Ravi Saive,

    Good evening.

    I have a doubt in the below line.
    mark beta.database_server.com=(tom) ALL

    My understanding is ‘mark’ and ‘tom’ both are the sudo users, both users have same (ALL commands )access on beta.database_server.com machine.

    Is this correct? or any difference is there in between ‘mark’ and ‘tom’ users in terms of privileges on beta.database_server.com machine?

    Thanks in advance.

    Thanks

  2. Could you please explain more about Q2, i didn’t quite catch that. As per to the question, user tom which is supposed to execute system command as user other than root on the same database server.

    mark beta.database_server.com=(tom) ALL

    Mark — Sudo User
    beta.database_server.com — machine name
    tom — effective user
    ALL — Any command can be executed

    After login with Mark user, try executing commands it says permission denied. Would you please provide more clarification

  3. Roger Gardner says:

    How can I get sudo to use the root aliases in /etc/bashrc?

    • Ravi Saive says:

      @Roger,
      That’s not possible, either add aliases to sudo user .bash_profile file, or for global use add in /etc/profile file.

  4. Mushthaq says:

    Hi friends,

    I have two user accounts. let test1 and test2. How can I switch to test2 from test1 without prompting password.
    :$su test2

    Any idea, please contact me at mushthaq089@gmail.com

    • Ravi Saive says:

      @Mushthaq,
      That’s not possible, because both are different users with different home directories, you must enter password to login to user account..

      • kannan says:

        What if the password is not set for neither of the users? It still prompting for password and what we have to give?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's