Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

Cheers

share|improve this question
add comment

1 Answer

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:

sshd: sammy.badguy.net

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
add comment

Your Answer

 
discard

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.