How to add a user in the sudo list
If you need to type commands using sudo, you will soon be tired to enter the sudo password again and again. Here are the steps to add a user in the sudo user list and to avoid typing the password. note that those commands need to be run with sudo.
First, edit the file /etc/sudoers, and add the following line somewhere:
%users ALL=(ALL) ALL
Save and exit. Then, you need to add your name to the user group. Type the following command in a shell:
usermod -a -G users <your username>
From now, you can use the command sudo from your account.
How to automatically login as sudo user without password
However, you will still need to enter the password. So, to avoid this annoying requirement, you can edit /etc/sudoers and add this command at the end of the file:
%admin ALL=(ALL) NOPASSWD: ALL
Save and exit. Finally, you will also need to create the “admin group”:
and again, you need to be part of the admin group. So type this command in a shell:
usermod -a -G admin <your username>
You should be able to use sudo without password from now on.