SSH Setup — Termux to VPS
One-liner command to install OpenSSH in Termux and connect to the VPS.
Command
pkg install -y openssh && { [ -f ~/.ssh/id_ed25519 ] && ssh -o StrictHostKeyChecking=accept-new pi@188.166.230.202 -t "cd /home/pi/vault && exec bash -l" || (ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" && cat ~/.ssh/id_ed25519.pub); }
What it does
- Installs OpenSSH package
- Checks for existing Ed25519 keypair
- If key exists: SSH directly to VPS and land in vault directory
- If no key: Generate new keypair and output public key (for manual copy to VPS
~/.ssh/authorized_keys)
Connection details
| Parameter | Value |
|---|---|
| User | pi |
| Host | 188.166.230.202 |
| Working dir | /home/pi/vault |
| Key type | Ed25519 |