Home Assistant Community

Editing configuration.yaml - permission denied

#1

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.

#2

What setup do you have? Hassio ? Hassbian?

#3

Hass.io on rasbian stretch.

#4

Have you installed the samba add-on?

1 Like
#5

@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.

#6

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
#7

@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.

#8

Another convert :wink:

1 Like