Skip to content

Instantly share code, notes, and snippets.

@qqpann
Created September 29, 2018 16:34
Show Gist options
  • Save qqpann/f026a65f76ea497e3983158d6bbdb3d4 to your computer and use it in GitHub Desktop.
Save qqpann/f026a65f76ea497e3983158d6bbdb3d4 to your computer and use it in GitHub Desktop.
[SSH limit access by IP] Allow ssh access from only desired ip. #SSH #IP
PasswordAuthentication no
PubkeyAuthentication no

Then add desired authentication methods after a Match Address in the end of the file. Placing Match in the end of the file is important, since all the configuration lines after it are placed inside the conditional block until the next Match line. For example:

Match Address 127.0.0.*
    PubkeyAuthentication yes

reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment