Skip to content

Instantly share code, notes, and snippets.

@IQAndreas
Created August 7, 2015 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IQAndreas/2f5ee3ca63527b03184d to your computer and use it in GitHub Desktop.
Save IQAndreas/2f5ee3ca63527b03184d to your computer and use it in GitHub Desktop.
See [_SuperUser: Block Access from outside of LAN_](http://superuser.com/q/952192/114760)
# This is the setting that is ONLY available if you are SSHing from the LAN (allow the listed users)
Match Address 192.168.0.*
AllowUsers git adam bob cliff dave
# This displays a message if the user NOT 'git' AND connecting from outside of the LAN
# Note, the extra *, is due to this bug: http://superuser.com/q/952235/114760
Match User *,!git Address *,!192.168.0.*
ForceCommand /bin/echo "Sorry, you are only allowed to connect to this server via git."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment