SSH Server
We recommend that you use SSH Server from Termux instead of using it in a Linux environment. Using an SSH Server from Termux gives you control of both your device and your Linux OS. We are providing you both the methods for the same down below-
SSH via Termux
You can follow this link to get to know the process of using SSH from Termux. This tutorial is provided officially by one of Termux developers.
SSH via Linux
Since Linux is executed by using PRoot, it cannot override the default configurations of the Android connectivity, so the port number needs to be changed. Follow the below steps to use SSH from Termux:
Install OpenSSH
Install openSSH inside Linux. Choose the command for your distro accordingly from the given list:
Ubuntu 20
apt install openssh-server nano -yUbuntu 18
apt install openssh-server nano -yKali Linux
apt install openssh-server nano -yDebian
apt install openssh-server nano -yManjaro
pacman -S openssh nano --noconfimArch
pacman -S openssh nano --noconfimFedora
dnf install -y openssh-server nanoAlpine
apk add openssh-server nanoVoid
xbps-install openssh nanoModifications
Once OpenSSH server is installed on your Linux system, we need to modify some things to make it accessible in network escaping Android limitations. Now execute-
nano /etc/ssh/sshd_config- Find and change the line
#Port 22toPort 2222 - Find the line
#PermitRootLogin prohibit-passwordor#PermitRootLogin yesand change it toPermitRootLogin yes. If it is alreadyPermitRootLogin yesthen you do not need to change anything. - Now when you are done with all the above steps press
CTRL+Xand then typeYand then pressEnter
Connect
Now just type
ip aand copy the IP Address of wlan
and to connect to SSH Server. To connect to SSH server type
ssh root@localhost -p 2222and use the password to connect to the server.