SSH From Termux: Install openssh and Connect (Client Only)
Use Termux as an SSH client to log into a server you already have access to (VPS, home lab, school Linux box). Package name from the Termux Remote Access wiki: openssh. This guide covers the client only—not running sshd on the phone, not hardening remote servers, and not bypassing anyone’s access controls.
What You Need
- F-Droid Termux + Wi‑Fi / mobile data.
- A remote username, hostname or IP, and password or SSH key you already own.
- Knowledge of the SSH port (usually 22; some hosts use another).
Install openssh and connect
Step 1: Install openssh
Wiki recommends
openssh(also offersdropbear; stick with openssh for familiarity):pkg update pkg install openssh ssh -V
Step 2: Connect on the default port
Replace with your account and host:
ssh user@hostname_or_ip
First connection: confirm the host key fingerprint if prompted (yes). Then enter your password (characters won’t echo—that’s normal).
Step 3: Non-standard port
If the remote sshd listens elsewhere (wiki example uses 8022 for Termux-as-server; your VPS may use another):
ssh -p 2222 user@hostname_or_ip
Step 4: Optional: key file with -i
If you already have a private key on the phone:
ssh -i ~/id_rsa user@hostname_or_ip
Keys under
~/.ssh/are picked up automatically; use-iwhen you keep multiple keys. Protect private keys—don’t paste them into chat or shared storage carelessly.Step 5: Leave the session
Type
exitor press Ctrl+D to return to the local Termux prompt.
Official docs
- Remote Access (SSH client): wiki.termux.com/wiki/Remote_Access
- Package Management: wiki.termux.com/wiki/Package_Management