Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to kill ssh connections to my server if they are from a particular 'office'

Any ideas how I would do this without using ip-tables?


share|improve this question

You can use what are called "TCP wrappers", the /etc/hosts.allow and /etc/hosts.deny files to restrict access. For example, you can add the line:


to /etc/hosts.deny.

You generally don't need to restart networking of services for changes to /etc/hosts.deny to take effect, however, you should test after making any changes, especially if made changes remotely while logged in via SSH.

You can find a more complete guide to controlling SSH access with TCP wrappers here.

You can also read

man hosts.deny
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.