Control termux remotely from a computer

This guide is intended to be included on other articles as an alternative to typing in all those commands on a termux terminal, since Android keyboards are not the most confortable and complete with all the symbols and characters required. Make sure that your Android device and your computer are both connected to the same router.

Part 1: Install and setup OpenSSH

  1. Open termux on your Android TV or Phone and type the following:
    pkg install openssh
    passwd

    2. Termux will now ask you to type in a password and to confirm it

    New password:
    Retype new password:
    New password was successfully set.

Part 2: Start OpenSSH and connect to it from a Windows computer

  1. Still in Android, type this to start OpenSSH in Termux and retrive the Ip Address:
    sshd
    ip r s

    Then youll see in the Terminal something like this:

    Take note of the last IP Address, in this example, it is 192.168.0.10

  2. Now go to a windows computer and open a command prompt:
    1. In Windows, open the start menu and type in “CMD” (without quotes). In mac open lancher and type “Terminal”
    2. Click on Command Prompt or Terminal to open a black console box.
  3. In the black console box, type this, replacing it with the correct IP Address that you took note earlier in the step 1:
    ssh 192.168.0.10 -p 8022

    4. You will be asked if youre sure you want to connect, type in the whole word “yes”.
    5. Then youll be asked for a password, type in the same one you set earlier on Part 1 step 2.

That’s it! You’ll see the message “Welcome to Termux!” as well as some aditional info. Now all the instruccions you type here will be actually executed in your Android device Termux terminal. If you copy any text/commands from this blog or any other place, right click over the black console box to paste it there.

Leave a Reply

Your email address will not be published.