Whenever you add an SSH key to GitHub Enterprise via the Management Console, you can also specify which IP addresses to allow or deny connections from.

You must specify IP addresses, not hostnames.

For example, to only allow connections from 10.0.0.10, type from="10.0.0.10" in the text field before you paste your public key:

from="10.0.0.10" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYk7k1RM49DPq8UrWhO8bIgheqAZfjqXczCjRSHshq2/qt8tWBHeiLpgAUVYFoY5Hv3+JXvMkuFE4h7HZYUWp+xXVg63L0wosrq+cVo1od2ddwiyYsnUypguSqjNxRPQ4PGQoWCTGfTLLPh2Su1nHmAf/Z0fdZo3ojunLb42ErbvJ2cIWbM/PMzdEDpUMZyLrG1JL4tGVnSRweWoaFgK6EkfE+gkyytKPuOIZREVNrO4+awTXpLDqdC0h/FFmkQCrwEFqdsm6JPARfJKVnHm7RgedLN1cpFi9Jo7ZFu5dJPTbYBKnpwsmTQkJSahNVGGDO4fQUBdC9tcKUW0gvNkRR== GitHub Enterprise Admin User

To only allow connections from any IP address that begins with "10.0.0." or "10.0.1.", type from="10.0.0.*,10.0.1.*" in the text field before you paste your public key:

from="10.0.0.*,10.0.1.*" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYk7k1RM49DPq8UrWhO8bIgheqAZfjqXczCjRSHshq2/qt8tWBHeiLpgAUVYFoY5Hv3+JXvMkuFE4h7HZYUWp+xXVg63L0wosrq+cVo1od2ddwiyYsnUypguSqjNxRPQ4PGQoWCTGfTLLPh2Su1nHmAf/Z0fdZo3ojunLb42ErbvJ2cIWbM/PMzdEDpUMZyLrG1JL4tGVnSRweWoaFgK6EkfE+gkyytKPuOIZREVNrO4+awTXpLDqdC0h/FFmkQCrwEFqdsm6JPARfJKVnHm7RgedLN1cpFi9Jo7ZFu5dJPTbYBKnpwsmTQkJSahNVGGDO4fQUBdC9tcKUW0gvNkRR== GitHub Enterprise Admin User

To allow connections from any IP address that begins with 10.0.2." except for 10.0.2.10, type from="!10.0.2.10,10.0.2.*" in the text field before you paste your public key:

from="!10.0.2.10,10.0.2.*" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYk7k1RM49DPq8UrWhO8bIgheqAZfjqXczCjRSHshq2/qt8tWBHeiLpgAUVYFoY5Hv3+JXvMkuFE4h7HZYUWp+xXVg63L0wosrq+cVo1od2ddwiyYsnUypguSqjNxRPQ4PGQoWCTGfTLLPh2Su1nHmAf/Z0fdZo3ojunLb42ErbvJ2cIWbM/PMzdEDpUMZyLrG1JL4tGVnSRweWoaFgK6EkfE+gkyytKPuOIZREVNrO4+awTXpLDqdC0h/FFmkQCrwEFqdsm6JPARfJKVnHm7RgedLN1cpFi9Jo7ZFu5dJPTbYBKnpwsmTQkJSahNVGGDO4fQUBdC9tcKUW0gvNkRR== GitHub Enterprise Admin User

You can also specify IP addresses in CIDR notation. For example, "10.0.2.*" is equivalent to "10.0.2.0/24":

from="10.0.2.0/24" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYk7k1RM49DPq8UrWhO8bIgheqAZfjqXczCjRSHshq2/qt8tWBHeiLpgAUVYFoY5Hv3+JXvMkuFE4h7HZYUWp+xXVg63L0wosrq+cVo1od2ddwiyYsnUypguSqjNxRPQ4PGQoWCTGfTLLPh2Su1nHmAf/Z0fdZo3ojunLb42ErbvJ2cIWbM/PMzdEDpUMZyLrG1JL4tGVnSRweWoaFgK6EkfE+gkyytKPuOIZREVNrO4+awTXpLDqdC0h/FFmkQCrwEFqdsm6JPARfJKVnHm7RgedLN1cpFi9Jo7ZFu5dJPTbYBKnpwsmTQkJSahNVGGDO4fQUBdC9tcKUW0gvNkRR== GitHub Enterprise Admin User