Extract method wait_for_ssh