For macOS, Linux, Git Bash, WSL, and Android Termux. One script, one alias.
curl -O https://raw.githubusercontent.com/mymyanmarland/vps-connect/main/connect-vps.shchmod +x connect-vps.sh./connect-vps.sh --name vps2 --host <VPS-IP>ssh vps2Try the dry run first — it changes nothing: ./connect-vps.sh --dry-run --name vps2 --host <VPS-IP>
./connect-vps.sh --name vps2 --host <VPS-IP> — or just ./connect-vps.sh and answer the two prompts: alias, then IP.ssh vps2 — for a new VPS, run the script again with a new name and IP. For a new device, run it again on that device.| Option | Default | Meaning |
|---|---|---|
| --name | (prompted) | Short alias, letters/digits/-/_ only |
| --host | (prompted) | VPS IP or hostname, required |
| --user | root | SSH user on the VPS |
| --port | 22 | SSH port, 1–65535 |
| --key | ~/.ssh/id_ed25519 | Private key file to reuse or generate |
| --dry-run | off | Print steps only, change nothing |
| --help | — | Show help and exit |
Requirements: ssh and ssh-keygen. ssh-copy-id if available, otherwise a plain ssh fallback is used.