Question

Limit Access to my Website hosted on Digital Ocean

Posted June 9, 2021 71 views
CentOSSecurityFirewall

Hi Team DI,
Wanted to know how can I limit access to my website (or droplet to say) only to specific laptops/PCs being used in my office or my home.

Droplet details -

4 GB / 80 GB Disk / NYC1 - CentOS 7.6 x64

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there @kaustubhjsakpal,

What you could do is to use a firewall like CSF and lock down all ports. That way only the allowed IP addresses will be able to access the services running on the Droplet.

Here is a step by step tutorial on how to install CSF on CentOS:

https://www.digitalocean.com/community/questions/how-to-install-and-configure-config-server-firewall-csf-on-centos

Hope that this helps!
Regards,
Bobby

  • @bobbyiliev
    Thnx for the reply.
    Can I also use multiple SSH key pairs (on multiple computers) to achieve the same i.e. suppose I generate SSH key pairs on all those PCs on which I want the access and then save all the public keys from the generated key pairs on my droplet? Will that work?

    • Hi there,

      Yes this is also doable. Each new SSH public key would need to be added to the ~/.ssh/authorized_keys file so that you could SSH from each new device.

      Hope that this helps!
      Regards,
      Bobby