SSH
Learn how to run an SSH server on your Android device with Andronix, either from Termux (recommended) or from inside your Linux distro.
This page is for Andronix with Termux. SSH into a distro in the app isn't tested or supported in 10.1; if you try it, the SSH server must use a port of 1024 or higher (like 8022), and it runs only while the distro runs.
SSH lets you access your device's shell remotely. This page covers two ways to run an SSH server: from Termux and from inside your Linux distro.
We recommend running the SSH server from Termux rather than from the Linux environment. An SSH server running in Termux gives you control of both your device and your Linux OS. Both methods are described below.
SSH via Termux
Follow this guide to learn how to run an SSH server from Termux. The tutorial is officially provided by one of the Termux developers.
SSH via Linux
Since Linux runs through PRoot, it cannot override Android's default connectivity configuration, so the SSH port number needs to be changed. Follow the steps below to run SSH from Linux:
sudo in front of each command below, skip the PermitRootLogin change and the root password step, and connect as your user, for example ssh alex@192.168.xx.xx -p 2222.Install OpenSSH
Install OpenSSH inside Linux. Pick the command for your distro from the list below:
Ubuntu
apt install openssh-server nano -yKali Linux
apt install openssh-server nano -yDebian
apt install openssh-server nano -yManjaro
pacman -S openssh nano --noconfirmArch
pacman -S openssh nano --noconfirmFedora
dnf install -y openssh-server nanoAlpine
apk add openssh-server nanoVoid
xbps-install openssh nanoModifications
Once the OpenSSH server is installed, you need to change a few settings so it's reachable over the network despite Android's limitations. Open the SSH config file:
nano /etc/ssh/sshd_config- Find the line
#Port 22and change it toPort 2222. - Find the line
#PermitRootLogin prohibit-passwordor#PermitRootLogin yesand change it toPermitRootLogin yes. If it already saysPermitRootLogin yes, you don't need to change anything. - When you're done, press
CTRL+X, typeYand pressEnterto save.
Connect
Run the following command:
ip aand copy the IP address listed under wlan. To connect to the SSH server, run:
ssh root@localhost -p 2222and log in with the password you set earlier.
Modded OS in Termux
Install, start and remove a Modded OS edition with Termux - the app copies the install command with its download token, andronix desktop opens it, andronix remove removes it.
Make It Faster in Termux
Speed up a distro in Termux - the light profile (andronix tune), and the Termux:X11 and VNC resolution.
