The first user in given sudo privileges if created with a group id
I have noticed that when creating the first user in an installation with a group id the account has sudo privileges. I have tried this by accessing the one available at: https://bellard.org/jslinux/vm.html?url=alpine-x86.cfg&mem=192
localhost:~# uname -a Linux localhost 4.12.0-rc6-g48ec1f0-dirty #21 (closed) Fri Aug 4 21:02:28 CEST 2017 i586 Linux
localhost:# adduser -G users tele1
Changing password for tele1
New password:
Bad password: too short
Retype password:
passwd: password for tele1 changed by root
localhost:#
localhost:#
localhost:# sudo -lU tele1
User tele1 may run the following commands on localhost:
(ALL) NOPASSWD: ALL
localhost:~#
If I create additional users in a similar way they do not have sudo
localhost:# adduser -G users tele2
Changing password for tele2
New password:
Bad password: too short
Retype password:
passwd: password for tele2 changed by root
localhost:#
localhost:~# sudo -lU tele2
User tele2 is not allowed to run sudo on localhost.