• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Enable Passwordless Sudo for User in Linux

Written by Rahul, Updated on 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

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Debian 10
  • Download Ubuntu 20.04 LTS – DVD ISO Images
  • Linux Run Commands As Another User
  • How to Check PHP Version (Apache/Nginx/CLI)
  • How To Install and Configure GitLab on Ubuntu 20.04
  • How to Install PyCharm on Ubuntu 20.04
  • How to Check Ubuntu Version with Command or Script
  • How to Set all directories to 755 And all files to 644
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy