0

How can I only allow ssh access from the local network (192.168.X.X) and drop all requests from the internet? What is the best option? adding an iptables rule or modifying the /etc/hosts.allow ?

  • when it comes to security you want to have defense in depth - that way if there is an error in the config or implementation you are still protected. I would suggest adding a firewall rule, configuring tcpwrappers and modifying the SSH rule in sshd,conf. Yu can rerad more here raspberrypise.tumblr.com/post/149800066154/… – Steve Robillard Feb 26 '17 at 15:58
  • You may also want to consider adding fail2ban. – Steve Robillard Feb 26 '17 at 16:26
  • @SteveRobillard thanks for the link on the sshd config options. Do you know how to implement the same thing using iptables? – ECII Feb 26 '17 at 16:33
  • ufw is just a frontend to iptables. – Steve Robillard Feb 26 '17 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.