I am not a new user on unix and linux. Before today I know everything works needs a logical configuration to make it work.
But today, when I create ubuntu instances on google cloud, I found something unusual.
I create an additional user besides the default cloud shell user which I use browser to login.
the additional user has the correct entry in /etc/group, but the cloud shell user doesn’t. They both are added to sudoers through google-sudoers group.
sudoers configuration:
/etc/sudoers:
”’
root ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
%sudo ALL=(ALL:ALL) ALL
#includedir /etc/sudoers.d
”’
files in /etc/sudoers.d:
”’
root@master:/etc/sudoers.d# ls
90-cloud-init-users README google_sudoers
root@master:/etc/sudoers.d# cat 90-cloud-init-users
ubuntu ALL=(ALL) NOPASSWD:ALL
root@master:/etc/sudoers.d# cat google_sudoers
%google-sudoers ALL=(ALL:ALL) NOPASSWD:ALLroot@master:/etc/sudoers.d#
”’
/etc/group:
”’
sudo:x:27:ubuntu
admin:x:113:
netdev:x:114:ubuntu,scott.lai,scott2020test
_chrony:x:115:
ubuntu:x:1000:scott.lai,scott2020test
google-sudoers:x:1001:scott.lai
scott.lai:x:1002:
scott2020test:x:1003:
”’
NO where to find scott2020test in google-sudoers, so how does scott2020test been included in google-sudoers?
Please notice that ubuntu is in sudoer file as a user, not a group.
Can someone explain?