Last Updated: February 25, 2016
· danielpuglisi

Exclude hosts in ssh config

To exclude specific hosts or IP-ranges from a specific ssh configuration, you can simple add an ! before the hostname.


Host * ! !192.168.0.? !*.local
  # config goes here

This configurations matches all hosts except, all hosts in and all hosts with the .local TLD.