GitHub ↗

Bash version

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.sh
chmod +x connect-vps.sh
./connect-vps.sh --name vps2 --host <VPS-IP>
ssh vps2

Try the dry run first — it changes nothing: ./connect-vps.sh --dry-run --name vps2 --host <VPS-IP>

1. Put the script on your terminal device.
On a PC, download it and open a terminal in that folder. On Android, use Termux and download it there. This chat app itself is not a terminal.
2. Run it.
./connect-vps.sh --name vps2 --host <VPS-IP> — or just ./connect-vps.sh and answer the two prompts: alias, then IP.
3. First time only: type the VPS password in your own terminal, at that prompt.
Characters will not show while you type — that is normal. Never send a password in chat, email, or a screenshot. The script never stores it.
4. Done. Connect any time.
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.

Options

OptionDefaultMeaning
--name(prompted)Short alias, letters/digits/-/_ only
--host(prompted)VPS IP or hostname, required
--userrootSSH user on the VPS
--port22SSH port, 1–65535
--key~/.ssh/id_ed25519Private key file to reuse or generate
--dry-runoffPrint 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.