you probably edited dietpi.txtto config some stuff (like the wifi) on the very first boot after flashing. But these settings only apply on the first boot, so you can not use this file anymore to change the wifi settings.
Now you need to directly edit the wifi config, which is located at:
Hi. Thx. for your reply. This is the files content here:
# WiFi country code, set here in case the access point does send one
country=DE
# Grant all members of group “netdev” permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
That’s it. I can’t see anything related to the new environment like SSID, Passphase etc. …..
# WiFi country code, set here in case the access point does send one
country=FR
# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
network={
ssid="SFR_xxxx"
scan_ssid=1
key_mgmt=WPA-PSK
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
}
network={
ssid="Livebox-xxxx"
scan_ssid=1
key_mgmt=WPA-PSK
psk="xxxxxxxxxxxxxxxxxxxxxxxxx"
}
Question… I recently went to do the same thing on a RPi Zero W and Zero 2W due to a change to the name of my WAP, but when I mounted the microSD card on my Chromebook, /etc/wpa_supplicant/wpa_supplicant.conf had permissions 0600, with owner/group ‘nobody/nobody’. As a result, even as the root user (on the Chromebook) I couldn’t edit the file. I didn’t want to get too rambunctious with it, so I ended up just changing the WAP name back temporarily, and ssh’ing back into the RPi’s and editing the file directly on the device to add a new network with the modified name.
Is there some trick I missed when mounting the micro SD card, that I wasn’t able to edit the files, even as root?
Usually root should have permissions always. And you would need to go to the mounted directory. If you go straight to /etc/wpa_supplicant/wpa_supplicant.conf, it’s the file from host system and not from mounted device.
ChromeOS has a kinda weird way of mounting stuff so it’s available to the Linux subsystem… you have to select the desired file/folder, click through some options to ‘make it available to Linux’, and then it gets mounted under /mnt/chromeos/removable. So if I plug in the micro SD card, it auto mounts, and opens in the Files app. Navigate to the second partition, find the /etc/wpa_supplicant directory, make it available to Linux, then open the terminal and navigate to it via the CLI. From there I can do most of the usual Linux stuff - ls, less, cat, vim, etc.
Problem is, I’m guessing, the uid/gid on the dietpi file system doesn’t map to anything in the ChromeOS system, so it gets mounted as owned by nobody/no group, permission 0600 ie -rw------- which makes it kind of a bear to edit, even as root.
this might be a challenge of ChromeOS not being able to handle the file system correctly. I don’t use ChromeOS, so might be wrong.
The original file is owned by user root
root@DietPiProd:~# ls -la /etc/wpa_supplicant/wpa_supplicant.conf
-rw------- 1 root root 219 Jun 17 2022 /etc/wpa_supplicant/wpa_supplicant.conf
root@DietPiProd:~#
The root account commonly uses the same UID 0 and GID 0 across Unix-like systems
root@DietPiProd:~# id root
uid=0(root) gid=0(root) groups=0(root)
root@DietPiProd:~#
Because so many tools, installers, and kernel components assume that UID 0 and GID 0 represent the superuser, nearly every mainstream distribution sticks to this.
usually root is able to edit everything, even files haven no permission (0000) at all
Indeed confusing. I hope these IDs did not change permanently, but that this is some strange visual behavior of ChromeOS. nobody is intended to have absolutely no permission on anything aside of “others”. So a system where everything is owned by nobody is kinda compromised.
mounts can be given a uid=/gid= mount option, but AFAIK this does not recursively affect all contained files … never really used these .
How did you mount the drive? Just via `mount /dev/mmcwhatever /mnt/somewhere
… ah I see from the mountpoint above it seems to have been some GUI or other CLI method. Maybe this includes some mount options which intentionally prevent users from accessing root-owned files inside or so.