Can't access configuration.yaml

Hi, I’m new to home assistant and is running it on a Raspberry pi 3 b+ . After setting up all my devices and automation, today I was trying to configure remote access via DuckDNS. But myself being an TOTAL idiot added

http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

to my configuration.yaml file without even installing DuckDNS to hass.io, now I cannot access the home assistant UI at all ! I also did not install samba nor the ssh addon. :frowning: HA is still up and running and I’m still able to control my devices via Homekit. But now I can’t edit or configure anything.

Is there any other way not through the Hass configurator to edit my configuration.yaml file so I can delete the commands.
When I try to plug in the SD card to a Mac or a PC the following shows up

The disk you inserted was not readable by this computer.

Do I really have to restart from scratch, it would totally suck, after I’ve spent hours and hours with my automations and customizing the UI… I’m desperate and any help/tips would be hugely appreciated

PLEASE HELP! :disappointed_relieved:

you’ll need to enable debugging. see here
https://developers.home-assistant.io/docs/en/hassio_debugging.html

1 Like

Basically you’ll need to format an USB drive, name it CONFIG, then copy your ssh public key, id_rsa.pub, to a file called authorized_keys, place that file in the USB root directory (not inside any folders). When you reboot the pi, it will import the file from the USB and place it in the right place so you can ssh to it on port 22222.

1 Like

Thanks a lot! will try it tomorrow. :smile:

Hi, I’m now in the Hass.io CLI :grinning: , this might sound stupid, but I can’t figure out how to edit the configuration.yaml file. Can you please help :sweat_smile: Thank you!

There are many ways you can edit your configuration.yaml file. I usually just ssh into my RPi and edit it using vim, nano is an easy editor you can use for simple editing.
I don’t know what your primary Operating System is, and I haven’t really used any other OS but Linux in a decade, so I might not be of much help if that’s not what you are using.
In Linux if I want to use an editor with a graphical interface, on my main machine I mount the [email protected]/~/.homeassistant directory through sftp so I can edit those files as if they were in my local computer. A lot of people do the same in Windows using Samba for example.
I believe there are posts here where that question has already been answered. I recommend you do a search or post a new question if you can’t find what you need.

Jardi.

1 Like

Thanks for the help, I’ve decided to start over at last, as I was already planning to upgrade to a bigger SD card, this time I’m going to make sure I have backup/samba… setup. Thanks for everything!

Hi there!
Got exactly the same problem. But I dont wath to loose all my automations.
I did as Jardi said, but it doesn’t work. I still don’t have the ssh access.

Can somebody help me?

What hardware are you using, and how is HA installed ?

Pi5 + M.2 HAT with 2025.04 HA Os. But SSH was not installed in HAos before the failure((

if you can attach a monitor and keyboard, you can fix it.

First, do what @francisp said.

I don’t have a Pi5 or M.2 HAT, but can you boot Raspian from a MicroSD? If you can then do that, mount the M.2 and you can get to the /config folder. Copy it to a thumb drive, then remove the Raspian MicroSD and reboot back into Home Assistant.

FYI- The very first thing I do in a new install is to install three add-ons: Advanced SSH & Web Terminal, Samba Share and Samba Backup.

Yes, I have the monitor and keyboard.
I tried to connect m.2 to my laptop but it can’t manage the disc - just unformatted space with the only possibility - to format.

I tried to boot from SD with Raspbian, but my Pi5 still boots from m.2((

I’m a newbie in this field, so didn’t know about such a problems. Now I know. Thanks!

That is because the M.2 is formatted for Linux. There is a small NTFS partition on it that your PC can see, but that’s little use to your problem.

Do you have a USB adapter for the M.2 SSD? If you have another Raspberry Pi or any Linux computer, mounting the M.2 is the easiest solution.

Configuration.yaml is located in /mnt/data/supervisor/homeassistant

So if you have a monitor and keyboard attached, you enter

login

(no password)

and then

vim /mnt/data/supervisor/homeassistant/configuration.yaml

for vim commands, see How to Exit Vim: A Beginner’s Guide | Built In

basic ESC :wq

when you are back at the #prompt

exit

then when you are back at the ha prompt

ha host reboot
1 Like

That works! Thank you very much!!!