In My Prievurs Post, I showed You, How you can Install Termux in Windows but those methods take a lot of space in your computer or they are not exactly termux apk. So in this post, I am gonna show you how you can Use Termux SSH Server to access termux in your Windows Terminal. We will not install the actual termux in windows but we will use it with Remote Access. This post will have all the Termux SSH commands, 🔥 And this Termux SSH configuration will allow yout to Use android Termux to ssh into linux pc or laptop and it will work with all the terminals which support ssh. This is going to be a detailed Termux SSH tutorial 📱.
What is SSH Server in Termux?
SSH stands for secure shell and it a cryptographic network protocol. With The help of ssh two computers can access data without any third person intercepting in between. It is more secure than other protocols because it is encrypted. You can use ssh in Termux to make a Private tunnel for you so that you can access your Termux in Windows easily.
Termux is CLI-based so while accessing the termux in Windows you will feel like its installed in your computer. It never lags, It does not disconnect, and it never malfunctions, You can easily install tools while using it with windows If you have a Windows then You should try this.
You can also access it and set up your termux fully like a hacking machine, like installing tools and creating all the files that you can use any time you want. I have only tested it on Windows 10 and it works perfectly but maybe Windows 7 & 8 do not have ssh preinstalled if this method does not work for you then I have Written this Post for you Guys : [ Termux Tmate : Access Termux Remotely In Any Browser ]
Use Termux in Windows using SSH Server:
Please read this article carefully because this one is not just copied and paste, if you miss any part then it won't work.
pkg install openssh nmap -y
Step 2: [ Run SSH Server in Termux ]
Now Run the ssh server by typing the below command. This command will start ssh server in your termux app.
sshd
Step 3: [ Get your User ID ]
Now the termux ssh server is running and you have to set up a password for user in termux type the below command in termux and copy your username.
whoami
make sure you copy the full name as given in the above picture.
Step 4: [ Configure Termux Password ]
After copying the username we have to set up a password for it by typing the below command, Just paste your username in the green part of the command and Press enter.
passwd u0_a298
after pressing enter, it will ask you to enter a password, you have to type any password you want but make sure you won't forget it (just type 1234). after you type your password and press enter, it will ask you to retype your password, Just type the same password again. Also, it will not show you what you are typing but it's there so it's just invisible but the password is there.
Step 5: [ Find local IP ]
Now you have to find your local IP Address, Make sure your computer and your phone is on the same Wifi network or it won't work. Type the below command to find out your IP-Address.
ifconfig wlan0
You will find your own IP address at the same location I have shown in the above picture.
Step 6: [ Find the Port ]
There is one more thing that we need is the ssh port, that you just have to type the below command and you will see your ssh port number ( mostly it will be 8022).
nmap localhost
In the above picture, you can see that my ssh port is on 8022. If you don't see any port then you should type sshd and then again run nmap localhost.
Step 7: [ Connect Termux ssh in pc ]
This is Step is the main Step, Now open the command prompt on your computer by pressing CTRL+ R and then type cmd and press enter. Now here you have to type the command to connect your termux with your Command prompt.
ssh username@your-Ip-asdress -p portnumber
example: ssh u0_a298@192.168.1.201 -p 8022
In the above command, you have to enter your username in the green part, You have enter your IP address at the pink part and the port number at the red part. Type the correct command and press Enter.
Step 8: [ Enter Password ]
After you type the correct command and press enter you will see, in the last line it says that "are you sure you wanna continue connecting" Just type Yes press Enter. And Now you have to type your password that you used while setup, type that password and Press Enter and you will be inside your Termux Terminal.
How to resolve sshd: no hostkeys available -- exiting Error in Termux?
ssh-keygen -A
How to Close the SSH server in Termux?
pkill ssh
How to Restart the SSH server in Termux?
[Update] Live Screen Mirror While doing SSH in Termux?
Step 1:
Firstly, You have to install the screen package in termux. This package allows you to see live update on both the terminals while they are in one common SSH shell.
pkg install screen
Step 2:
Now when both devices are connected in an SSH shell, on the primary device you have to type the below command.
screen -S nix
And on the secondary device have to type the below command.
screen -x nix
Above, both the commands are interchangeable, and you just have to put these 2 commands in 2 separate devices while they are on the same SHH shell, and you will be able to see the live screen updates.
4 Comments
my pc tells me ssh is not recognised as an internal or external command,
ReplyDeleteoperable program or batch file.
in my command prompt
You need an SSH client, like PuTTY (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html). Some newer versions of windows may have the "ssh" program installed for command prompt like in the above picture.
Deletecmd says 'ssh' is not recognized as an internal or external command,
ReplyDeleteoperable program or batch file.
Hi, everyone ! Help
ReplyDeleteHow can I do to transfer files from my Android phone to PC and access them in my PC. The commands instructions made on the phone and not on the PC like adb-transfer-method.
Thank you for your help.