Editing configuration.yaml - permission denied

I am trying to edit the file for the first time and when I try to save I get the following error:

Error opening file ‘/usr/share/hassio/homeassistant/configuration.yaml’: Permission denied
The file on disk may now be truncated!

What I did so far:

  • Give the file write permission via sudo chmod 664 /usr/share/hassio/homeassistant/configuration.yaml
  • Attempt to add my user, pi, to the sudo group via: sudo usermod -aG sudo pi

I am still not able to edit the file and now when I open it, it appears empty. So I somehow managed to delete its contents apparently, but still can’t save it.

What am I doing wrong here?

Edit: Now I am also getting the “inode / x-corrupted” error.
Edit 2: sudo chown pi /usr/share/hassio/homeassistant/configuration.yaml also didn’t work.

What setup do you have? Hassio ? Hassbian?

Hass.io on rasbian stretch.

Have you installed the samba add-on?

1 Like

@GaryK no, I am using Mac. Would it help on a mac? I thought it would be easier to work directly on the pi, but I guess not.

mac does samba. I had permission issues editing files on the host. I think this is to protect us from ourselves. No problem editing via samba.

1 Like

@GaryK thx, samba did the trick! In the process I also learned how to edit files via command line, which also works great, in comparison with the GUI file explorer. For some reason, when I use the explorer and a coding editor, it just opens an empty file. The file type says something about node / x-corrupted and I get a bunch of permission errors, trying to save the file. Guess the command line is actually the better tool here.

Another convert :wink:

1 Like