Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to connect to Termux from Ubuntu desktop

In this example, we will setup a SSH server on Termux (for Android) and connect to the server from Ubuntu desktop. However, a similar procedure should work with any SSH server.

  1. Generate your ssh key pair on your desktop

    $ ssh-keygen
    
  2. Check your desktop IP address (say, 192.168.0.100)

  3. Run ssh server on your desktop

  4. Copy the file to Termux over SCP

    $ scp arun@192.168.0.100:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
    

    You can stop ssh server on your desktop now

  5. Install ssh server on Termux

    $ pkg in openssh
    
  6. Run ssh server on Termux (IP address 192.168.0.102)

    $ sshd
    
  7. Find out your username on Termux

    $ whoami
    u0_z007
    
  8. Connect from your desktop

    $ ssh u0_z007@192.168.0.102 -p 8022
    Welcome to Termux!
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment