Synology NAS – Locked Myself Out

Standard

So I was just trying to install & test a VPN on my Synology NAS box, but I managed to lock myself out by SSH, which is rather awkward.

On my Synology NAS, I have AutoBlock enabled after 3 failed logins and enabled 2-step verification, but it was entering my 2-step code I got myself locked out. I was trying to access my dashboard vis an SSH Tunnel and when logging in I entered my 2-step verification code wrong 3 times, and locked out my local IP, however I still had my SSH session open from a remote IP.

This requires you to be able to SSH into you NAS from a non blocked IP address

Open the Synology AutoBlock Database:
sudo sqlite3 /etc/synoautoblock.db`
Switch on table headers:
.headers on
Show all known IP Addresses
select * from AutoBlockIP;`
Show all blocked IP Addresses
select IP from AutoBlockIP where deny=1 and (ExpireTime > date(‘now’) or ExpireTime == 0);
Delete the IP address you want released, where your IP is , you could also set deny=0
delete from AutoBlockIP where IP=”“;
Quit SQLite
.exit

IP Addresses

For those not to familiar with how networking works in IPv4, your NAS can be reached by a local (LAN) IP or if you have configured it correctly through your public IP.

If you have got yourself locked out on your LAN (home network) where your NAS is also located, and were logging in using its Local IP of the form 192.168.., then you can try changing to a different IP address on your network.

One thought on “Synology NAS – Locked Myself Out

  1. Quick Update I found that I got locked out again, why you might ask ?
    I actually have 2 issues:

    • Using SSH Keys with Git in Source Tree
    • Using 2-step authentication in the Web Admin – It seems the NAS is drifting in time very slightly so the codes are out of step

Comments are closed.