Managing files, running scripts, and executing terminal commands on your smartphone from a computer is much more convenient through a full SSH session, eliminating the need to switch between device screens.
Installing OpenSSH
Open Termux and install the package for the secure protocol:
pkg update && pkg install openssh
Configuration
Set a password to secure the connection: passwd
Find your current username using the
whoamicommand (usually looks likeu0_a...).
Start the SSH server:sshd
Connecting from a PC
Find your smartphone's local IP address usingifconfig(look for theinetline under thewlan0interface).Note that Termux uses a non-standard port 8022 by default instead of the standard 22.
Connect from your computer (Linux, macOS, or Windows via PowerShell/PuTTY):
ssh <username>@<smartphone_IP> -p 8022
After entering your password, you will gain full access to your phone's terminal directly from your PC.
Autostarting the Server
To avoid starting the server manually every time you open the app, add the command to your shell configuration:
echo "sshd" >> ~/.bashrc
This tool turns your mobile device into a fully functional remote node that is easy to manage over the local network when developing and testing lightweight projects.
I share more simple and awesome smartphone IT projects on my Telegram channel: @termuxq
Top comments (0)