hetzneronline / installimage

Bash scripts to universally deploy various distributions
Other
517 stars 143 forks source link

Installimage fails. Permissions for /etc/netplan/01-netcfg.yaml are too open (Ubuntu 22.04) #96

Closed guettli closed 5 months ago

guettli commented 5 months ago

We use /root/.oldroot/nfs/images/Ubuntu-2204-jammy-amd64-base.tar.gz

[11:30:16] fatal: netplan generate stderr not empty:                                                                                  
[11:30:16] :                                                                                                                          
[11:30:16] :   ** (generate:3): WARNING **: 11:30:16.178: Permissions for /etc/netplan/01-netcfg.yaml are too open. Netplan configurat
ion should NOT be accessible by others.                                                                                               
[11:30:16] => FAILED

Running chmod 600 /etc/netplan/01-netcfg.yaml before executing installimage does not help, since it is not about the /etc directory in the rescue system. It is about the /etc directory of the Ubuntu 22.04 tgz.

Do you have an idea how to fix this?

guettli commented 5 months ago

Maybe this fix would help:

❯ git diff| cat
diff --git network_config.functions.sh network_config.functions.sh
index 84a28b4..2262e5f 100644
--- network_config.functions.sh
+++ network_config.functions.sh
@@ -720,6 +720,7 @@ setup_etc_netplan_01_netcfg_yaml() {
       gen_etc_netplan_01_netcfg_yaml_entry "$network_interface" || return 1
     done < <(physical_network_interfaces)
   } > "$FOLD/hdd/etc/netplan/01-netcfg.yaml" 2> >(debugoutput)
+  chmod 0600 "$FOLD/hdd/etc/netplan/01-netcfg.yaml"
 }
guettli commented 5 months ago

I guess this was fixed some days ago:

https://github.com/hetzneronline/installimage/commit/51157cc3eb2a74f89b184504f2db2a36bfcc3179#diff-2089e373bbe65d6179abc68303304830a59b1cc1ef52756c2e85bbe3a662ac2cR754

We were using an old version of installimage.