Raspberry Pi 3, user & sudo

Linux users
How do I add a user to the “sudo” group?
Change default users on Raspberry Pi

$ sudo adduser andreas

$ sudo usermod -aG sudo andreas
or
$ sudo adduser andreas sudo

$ ls -la /etc/sudoers.d/
total 16
drwxr-xr-x  2 root root 4096 Nov 29 01:29 .
drwxr-xr-x 83 root root 4096 Nov 29 03:15 ..
-r--r-----  1 root root   27 Oct 18  2016 010_pi-nopasswd
-r--r-----  1 root root  958 Jun  5 12:22 README

$ sudo cat /etc/sudoers.d/010_pi-nopasswd
pi ALL=(ALL) NOPASSWD: ALL

$ sudo visudo
[...]
# User privilege specification
root    ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL
andreas ALL=(ALL) NOPASSWD: ALL
[...]

=== Change to 'andreas' ===

$ sudo deluser pi
Removing user `pi' ...
Warning: group `pi' has no more members.
Done.

$ sudo delgroup pi
The group `pi' does not exist.

Leave a Reply

Your email address will not be published. Required fields are marked *