BYTESLIP ← Back
Knowledge Base // Tutorial 57 · Termux

SSH From Termux: Install openssh and Connect (Client Only)

Difficulty: Medium ~5–10 min Termux · F-Droid

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.

SSH client from Termuxpkg install opensshssh user@hostclient only · your accounts · port -pEASY–MEDIUM · SSH CLIENT
Checklist // Before You Start

What You Need

Walkthrough // Steps

Install openssh and connect

  1. Step 1: Install openssh

    Wiki recommends openssh (also offers dropbear; stick with openssh for familiarity):

    pkg update
    pkg install openssh
    ssh -V
  2. 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).

  3. 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
  4. 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 -i when you keep multiple keys. Protect private keys—don’t paste them into chat or shared storage carelessly.

  5. Step 5: Leave the session

    Type exit or press Ctrl+D to return to the local Termux prompt.

Pro Tip
Sources // Verified

Official docs

← All Tutorials Install Termux (F-Droid) Termux tutorials