Sometimes you need to wait for a just booted server to accept SSH connections. This can be solved with a one-line bash script:

until nc -w 10 -z $SERVER_IP 22; do echo "SSH not available" && sleep 5; done