Last active
May 19, 2017 23:41
-
-
Save yusent/384dfaaa021dc0355fbf4f67252089c0 to your computer and use it in GitHub Desktop.
Workaround to allow a limited number of connections per host in an old Unix server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Place this at the top of a file evaluated per connection (e.g. .profile) | |
max_allowed_connections=5 | |
address=`echo "$SSH_CLIENT" | cut -f1 -d' '` | |
connections=`finger -l | grep "$address" | wc -l` | |
if [ "$connections" -gt "$max_allowed_connections" ]; then | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment