Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Enable Passwordless Sudo for User in Linux

    How to Enable Passwordless Sudo for User in Linux

    RahulBy RahulDecember 18, 20191 Min ReadUpdated:February 15, 2020

    Sudo provides special privileges to any user or group. Some of the commands are accessible by the root user only. For example, a command to reboot the server. None other than the root user can reboot a Linux system but you want to provide the privilege to your team member, so they can reboot the instance on the absence of you. Then you can assign sudo privileges to that account.

    Instructions

    In this tutorial, you will understand how to configure passwordless sudo account on a Linux machine. After completing this tutorial, you can run super user commands (allowed) without entering a password.

    • Edit sudoers file using visudo command or use below command.
      sudo nano /etc/sudoers
      
    • Update entry for your user account with NOPASSWD: option as showing below:
      username  ALL=(ALL:ALL) NOPASSWD: ALL
      

      Change username with your user account and save file.

    Test

    All done, to test run any superuser command with sudo. The command syntax will be like:

    sudo your_command_here
    

    See the below screenshot before and after enabling the password-less sudo privileges for an account. The user needs to provide password before but after making changes the user can restart the apache service with sudo without entering the password.

    Password-less Sudo in Linux

    command linux sudo user
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleAutomatically Log off Disconnected User Sessions on Windows
    Next Article How to Install Tomcat 9 on CentOS/RHEL 8

    Related Posts

    What is the /etc/aliases file

    2 Mins Read

    What is the /etc/nsswitch.conf file in Linux

    2 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    How to Install Latest Git on Ubuntu 22.04

    Updated:May 31, 20222 Mins Read

    How To Install LibreOffice on Ubuntu 22.04

    Updated:May 23, 20222 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    • How to Install Angular CLI on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.