Most of the recent Linux distributions use sudo utility as a way to grant non-privileged users execute processes as privileged root users. By default 5 minutes is granted to a sudo user to enter privileged commands using sudo without password after first authentication. If you wish to give your users an access to run privileged command without password follow the instructions below.

First, assign user to a specific group. For example user on Fedora or Redhat systems by default belong to user group wheel.
$ id lubos
uid=1000(lubos) gid=1000(lubos) groups=1000(lubos),10(wheel)

In the example below we add user lubos to a new group called sudoers:
# groupadd sudoers 
# usermod -G sudoers lubos
# id lubos
uid=1000(lubos) gid=1000(lubos) groups=1000(lubos),1002(sudoers)
Now we need to edit /etc/sudoers the sudo config file to allow all users belonging to sudoers group to use sudo without password. For this we will use visudo command and add the following line:
%sudoers        ALL=NOPASSWD: ALL

Free Linux eBooks

Go to top