Use of Secure Firewall, Bastion Hosts and Access Control Lists are the way to prevent getting compromised by a hacker.
A hacker are unauthorized users who are seeking to break into a secured or unsecured computer systems.
The way you can restrict the connections and securing the server from getting compromised by a hacker includes:
Read more about hacker
brainly.com/question/24327414