Locked out of my home assistant

my local IP is being banned I have no way of accessing my home assistant to unban myself. I have my local IP as a trusted proxy but for whatever reason with the latest updated it decided to start banning my local IP.

How do I from the HA terminal unban my IP? All the instruction I can find online assume you can get to the ip_ban.yaml file. I can not login to do that.

I can get to the home assistant prompt that is it
ha>

If everything else fail you can do manual backup in home assistant 2025.1
Things you gonna need:

  • screwdriver

Unplug computer.
Grab screwdriver and remove computer plate. Unscrew hard disk and unplug it.

Plug removed hard disk to sdd tray and plug it in in your computer.

Open terminal and do

sudo blkid 

to see where is your hd.

When you find it do

sudo mount -n -o remount,rw -t ext3 /dev/sdb /mnt

Go to your hd, make necessary changes and umount it.

Put it back in your comp, screw everything back and plug it in. It should work.

1 Like

I have the HA OS running in a virtual machine. I have access to the following

I did a backup from 2025.1 to the prior version and that got me banned.

Well then I don’t know.

I figured it out with your info plus mounting the virtual disk. VM needs to be stopped

Document it here for others

modprobe nbd max_part=8
qemu-nbd --format=qcow2 --connect=/dev/nbd0 /mnt/user/isos/haos_ova-11.1.qcow2
fdisk /dev/nbd0 -l

find the largest partition

mkdir /mnt/disks/vdiskmount
mount /dev/nbd0p8 /mnt/disks/vdiskmount
nano /mnt/disks/vdiskmount/supervisor/homeassistant/ip_bans.yaml

Very comlicated. :wink:

At the ha prompt type: login
Then: vi /mnt/data/supervisor/homeassistant/ip_bans.yaml

nice! exactly what I was looking for Thank you

I’m glad you managed to sort thing out. You see, there is a solution to every problem.

http:
  ip_ban_enabled: true
  login_attempts_threshold: 2
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.0.0/24
    #- 172.30.32.0/23
    #- 172.30.232.0/23

Can anyone tell me why it recently started banning my local IP? Has not been an issue before. I dont think I will be upgrading to 2025.1.1 again. Everything works on the prior version.

If you have concerns, don’t upgrade until 2025.1.3 (or 1.4 or 1.5)
Turn off ip ban right before the upgrade above, backup your thing, and then proceed to upgrade.
Run for a few days / weeks, before you turn your ip ban back on.
If you want to be super cautious, maybe relax the ip ban threshold a bit, and then tighten over next few weeks.