DEV Community

[Comment from a deleted post]
Collapse
 
thedevspace profile image
TheDevSpace • Edited

Whitelisting your own IP is also an effective way to secure your server. However, you risk getting locked out of your server, since your IP address is not permanent.
If you are a modem user, each time you connect to the Internet, you'll be assigned an IP address that's available. If you are a broadband user, your IP address will be reassigned when the ISP change their infrastructure.
So I guess they both have pros and cons. I prefer using SSH keys, but make sure you make several copies and store them in different places.

Collapse
 
nicoroy2561 profile image
nicoroy2561

What I do is I create & manage a firewall using my host's website (rather than on the server itself). This way I can always log in to said host using my credentials+2FA and add/remove the IP address I want to allow SSH from anytime.