• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • How to configure passwordless sudo for a user in Linux

    To learn more about the various syntax used in sudoers file follow below link

    There is a parameter NOPASSWD which has to be used for your user to run allowed commands without providing their password everytime.

    For example:
    I want to all all the user of admin group to run bind services
    # visudo
    %admin  ALL=(ALL)      
    NOPASSWD: /etc/init.d/named reload

    Verify the changes. Login as deepak and try to run the command
    # su - deepak
    [deepak@test2 ~]$ sudo /etc/init.d/named reload
    Reloading named:                                          
    [  OK  ]
    Now as we see it didn't prompted for password.

    Just to allow a single user make the below changes
    deepak  ALL=(ALL)       NOPASSWD: /etc/init.d/named reload
    Allow the user to run all commands without getting prompted for password
    deepak  ALL=(ALL)       NOPASSWD: ALL
    I hope I made myself clear

    Related Articles
    How to give normal user root privileges using sudo in Linux/Unix

    Deepak Prasad

    is a techie and an author who is still trying to survive in this IT generation with very little knowledge he has on Linux/Unix, VMware, SAN Storage, Automation, networking etc

    You can follow him on Facebook or Google+

    Do you also have something to share here?
    Join GoLinuxHub Team as an Author, Click here for more information
    How to configure passwordless sudo for a user in Linux How to configure passwordless sudo for a user in Linux Reviewed by Deepak Prasad on Sunday, June 08, 2014 Rating: 5

    No comments:

    Powered by Blogger.