Ask the Expert

Blocking unauthorized IPs

I'm noticing several attempts by unfriendly IPs to gain access to my server through SSH. Can you help me through the steps of configuring my server firewall to block all IPs, except mine?

    Requires Free Membership to View

There are a number of ways of doing this depending on the configuration of your network:

  1. It is possible to use access control lists or rules on your networking devices to block incoming SSH access from all IP addresses except your own. For example, adding an iptables rule that restricts incoming SSH access to a single IP or subnet. An important consideration here though, is that if your IP address changes or you need to access the host from an address or network not specified in that ruleyou will not be able to connect. Make sure that you update the rule/ACL when IP addresses change and make sure you include all of the IP addresses from which you may require access.
  2. Secondly, you can use one of a number of tools like BlockSSHd or sshdfilter to dynamically block-in your firewall IP addresses that are the source of failed SSH logins.

This was first published in August 2006

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: