node-red / linux-installers

Node-RED install scripts for various flavours of Linux
Apache License 2.0
96 stars 63 forks source link

failing to install on GCP VM w/ Debian #48

Closed nycalex closed 7 months ago

nycalex commented 8 months ago

hello

i am trying to install on debian 12 (bookwarm) in GCP cloud, using the script from https://nodered.org/docs/getting-started/raspberrypi

script fails to detect that i have sudo rights (I do).

For my VM instances I use native google auth for SSH, meaning i authenticate to VM SSH with my gmail credentials.

what i see in my /etc/sudoers:

@includedir /etc/sudoers.d

next, in /etc/sudoers.d i see:

/etc/sudoers.d$ ls -la total 20 drwxr-xr-x 2 root root 4096 Feb 29 02:58 . drwxr-xr-x 77 root root 4096 Mar 2 22:45 .. -r--r----- 1 root root 1096 Jun 27 2023 README -r--r----- 1 root root 34 Feb 29 02:58 google-oslogin -r--r----- 1 root root 43 Feb 29 02:58 google_sudoers

next, i read inside the files:

sudo cat google-oslogin includedir /var/google-sudoers.d

next, cd /var/google-sudoers.d

/var/google-sudoers.d# ls -la total 12 drwxr-x--- 2 root root 4096 Feb 29 02:58 . drwxr-xr-x 13 root root 4096 Feb 29 02:58 .. -r--r----- 1 root root 52 Feb 29 02:58 myemail_gmail_com

at last, i do 'cat myemail_gmail_com" while in /var/google-sudoers.d and i see: myemail_gmail_com ALL=(ALL) NOPASSWD: ALL

This is how they integrate google auth into sudo architecture... so if your install scripts checks JUST for the username in sudoers, without doing full recursive check of all includes, it will fail to validate that i have sudo rights

P.S. i have Node21 installed P.P.S. potentially unrelated, but when i try to run the install with sudo, i get an error "bash: /dev/fd/63: No such file or directory"

THANKS for looking into it

dceejay commented 8 months ago

What does groups "$USER" return ?

nycalex commented 7 months ago

I created a workaround with a local non-google user, gave him sudoer rights and got through the installation. I think i'm ok for now. Thanks

dceejay commented 7 months ago

ok - but would be good to know as the test I do is against the groups and not the sudoers files

nycalex commented 7 months ago

Sorry, i deleted the environment yesterday after i finished playing with it.