Re: How to add configuration (~/.ssh/config) per ip?

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



hubert depesz lubaczewski wrote:
Is there any way to make ssh apply rules both based on name and based on
ip?

I could, of course, add special rule for each hostname, but that would
mean that my ~/.ssh/config will be huge, and constantly change (new
hosts added, old hosts removed).

Remember that you can use shell commands. So, assuming from your example that the second IP octet determines the jump host, you could do:

Host *.bb.cc
 ProxyCommand ssh -W %h:%p jump$(dig +short %h|cut -d. -f 2).bb.cc


Best regards

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux