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

  • Life always offers you a second chance ... Its called tomorrow !!!

    Sunday, June 08, 2014

    How to configure passwordless sudo for a user in Linux

    In this article I will be very brief on the topic. For more details you can read the below article on sudo and assigning permissions
    How to give permission to user to run some commands in Linux

    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

    Follow the below links for more tutorials

    Step by Step Linux Boot Process Explained In Detail
    RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail
    Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
    How to secure Apache web server in Linux using password (.htaccess)
    How to register Red Hat Linux with RHN (Red Hat Network )
    15 tips to enhance security of your Linux machine
    How does a DNS query works when you type a URL on your browser?
    How to create password less ssh connection for multiple non-root users
    How to create user without useradd command in Linux
    How to give normal user root privileges using sudo in Linux/Unix
    How to do Ethernet/NIC bonding/teaming in Red Hat Linux
    How to install/uninstall/upgrade rpm package with/without dependencies
    Why is Linux more secure than windows and any other OS
    What is the difference between "su" and "su -" in Linux?
    How to secure boot loader (grub menu) with password in RHEL 6


    Post a Comment