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

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Support TecMint: Did you find this tutorial helpful?. Please help to keep it alive by donating. Every cent counts! - Donate Now

Avishek Kumar

I am a major in computer science, love to research nix. I love to write codes and scripts, review distros, experiment Foss Technologies, write technical articles, Hack, of course Ethically. I am working as System Administrator (nix) for a NGO.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

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...

21 Responses

  1. 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

  2. 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.

  3. 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?

Leave a Reply

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

Join Over 95000+ Linux Users
  1. 66,682
  2. 3,836
  3. 31,647

Enter your email to get latest Linux Howto's