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
# Usage: ssh [email protected] | |
# Don't forget to put your API key (or a variable) in the ProxyCommand line. | |
Host *.lsw | |
# Uncomment these only if you absolutely trust your servers, and they change host keys often, for example when you use rescue mode a lot. | |
#StrictHostKeyChecking no | |
#UserKnownHostsFile /dev/null | |
#User root | |
ProxyCommand nc $(curl -s -X GET --url https://api.leaseweb.com/bareMetals/v2/servers/$(cut -d'.' -f1 <<< %h)/ips -H "x-lsw-auth: YOUR-LEASEWEB-API-KEY-HERE" | jq --raw-output '.ips[] | select(.mainIp==true) | .ip' | cut -d'/' -f1) %p |