SSH whitelist 2 addresses

7,734

This should be as trivial as

sshd : 124.567.890. : allow

Share:
7,734

Related videos on Youtube

Kevin
Author by

Kevin

Updated on September 18, 2022

Comments

  • Kevin
    Kevin over 1 year

    We want to block all access to SSH, except for two IP addresses. One address is dynamic, it starts with 124.567.890.xxx where xxx is changing all the time. I read that you can do this by changing /etc/hosts.allow? How can we do this?

  • Kevin
    Kevin over 12 years
    Thanks, and multiple addresses?
  • Kevin
    Kevin over 12 years
    Nvm, found it: sshd: 83.83.83.83 127.0.0.1 83.83.83.84 192.168.1.1
  • cjc
    cjc over 12 years
    In /etc/hosts.deny, you'll need to put in "sshd: ALL", so your combined rule will be deny all, allow X.
  • Kevin
    Kevin over 12 years
    Thanks, and how can I test the security? We only have one IP address right here.
  • Sergei
    Sergei over 12 years
    Is this relevant to your question? serverfault.com/questions/185153/…