SSH (Secure Shell) allows you to securely connect to remote servers, manage files, and run commands over a network. Termux includes OpenSSH, which gives you both an SSH client and server. This lets you connect to other machines or allow others to connect to your Termux device. Below are the installation steps and basic commands.
Installation
Update Termux packages:
pkg update && pkg upgrade -yInstall OpenSSH:
pkg install openssh -yCheck SSH version:
ssh -VStart SSH server in Termux:
sshdFind your IP address:
ifconfigSet a password for Termux login:
passwdBasic Commands
Connect to a remote server:
ssh username@server-ipConnect with a custom port:
ssh -p 2222 username@server-ipCopy files to a remote server using SCP:
scp file.txt username@server-ip:/path/Copy files from a remote server:
scp username@server-ip:/path/file.txt .Generate an SSH key:
ssh-keygenStart SSH server manually:
sshdStop SSH server:
pkill sshdCheck SSH server port (default 8022 in Termux):
sshd -p 8022Uninstall SSH:
pkg uninstall openssh