Remote Bootstrap (Troubleshooting)
This page covers common failures during ./infra.sh remote bootstrap (first-time server hardening).
Prerequisites
Before running bootstrap, verify:
-
You can SSH as root on port 22
ssh root@<SERVER_HOST> -
Local tools are installed
ansible --version
ssh-keygen -h >/dev/null
nc -h >/dev/null -
Secrets exist
.env.secretscontainsREMOTE_ROOT_PASSWORDandREMOTE_EXTERNAL_ADMIN_PASSWORD.- Server is registered:
./infra.sh server add <IP_OR_DOMAIN> --user root --port 22
Common Issues
1) "REMOTE HOST IDENTIFICATION HAS CHANGED"
When you rebuilt a VPS and reused the same IP/domain, your known_hosts entry is stale.
ssh-keygen -R <SERVER_HOST>
2) "Failed to connect via ssh" / UNREACHABLE
Most frequent causes:
-
Wrong host/user/port in inventory
./infra.sh server list -
Provider firewall blocks port 22
nc -zv <SERVER_HOST> 22 -
Server is not ready yet Wait a few minutes after provisioning, then retry.
3) Bootstrap hangs on reboot / waiting for SSH
Bootstrap typically changes SSH behavior (and may reboot). If it looks stuck:
-
Try both SSH ports
nc -zv <SERVER_HOST> 22
nc -zv <SERVER_HOST> 36987 -
If you have console access (VNC/serial), check SSH
systemctl status ssh
journalctl -u ssh -n 100 --no-pager
4) Cannot login as externaladmin after bootstrap
Typical causes:
-
Wrong port (use
36987):ssh -p 36987 externaladmin@<SERVER_HOST> -
Password mismatch: verify
.env.secrets(REMOTE_EXTERNAL_ADMIN_PASSWORD). -
Provider firewall blocks
36987(open it on the provider side first).
5) Network stabilization issues (provider-specific)
Some VPS images (e.g. Arsys) may require network stabilization. If bootstrap reports network validation failures:
-
Validate current network state:
ip addr
ip route
ping -c 3 8.8.8.8 -
Check for conflicting tooling:
ls -la /etc/netplan/ || true
ls -la /etc/cloud/cloud.cfg.d/ || true
Manual Recovery (Last Resort)
If you are locked out and only the provider console works:
-
Restore SSH port 22
sed -i 's/^#\\?Port .*/Port 22/' /etc/ssh/sshd_config
systemctl restart ssh -
Ensure the user exists and can sudo (adjust to your policy)
id externaladmin || useradd -m -s /bin/bash externaladmin
usermod -aG sudo externaladmin -
Retry bootstrap after access is restored.