I'm a new Linux user experimenting with Debian Trixie on my Raspberry Pi through SSH. After a reboot, my Pi's IP address changed, and now UFW has locked me out. I'm living in an apartment with internet provided by an external router, and I can't access the router's login page. Is there a way to set my Pi's IP to static without needing access to the router? I've also set up UFW, public-private key authentication (and disabled passwords), and Fail2Ban, in addition to changing my SSH port.
2 Answers
If you ever lose your IP, you might still be able to SSH using `user@machinename` instead. Also, trying `ssh [email protected]` could work, especially if you have mDNS set up. If you're looking for a more reliable solution, consider using Tailscale; it can simplify remote access significantly.
You can set a static IP directly on your Raspberry Pi, but be cautious. Depending on your router's setup, it might block traffic from an IP that wasn’t assigned via DHCP. Generally, when configured properly, UFW allows SSH access by default from anywhere, so it shouldn't lock you out if everything's done right.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures