Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Access Android Storage Remotely using Termux and SSH

References:

Steps

  1. Install Termux on android device.

  2. Find Termux username.

    $ whoami
    u0_a96
    
  3. Set a password.

    $ passwd
    
  4. Allow storage access:

    $ termux-setup-storage
    
  5. Install OpenSSH.

    $ pkg install openssh
    
  6. Start SSH server

    $ sshd
    $ pkill sshd  # for stopping the server
    
  7. Find IP of your android device.

    $ ip r
    192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.3
    
  8. Now you can SSH into your android device. You can access storage (/storage/emulated/0) because of termux-setup-storage

    $ ssh -p 8022 u0_a96@192.168.1.3
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment