How to access Android phone's storage from Termux

Use the following cmd in Termux

termux-setup-storage


This cmd will request permission to access phone's storage.

Grant the permission.




This will create symbolic links in Termux home directory

(/data/data/com.termux/files/home/storage)

to various shared storage locations on your phone


Its just a Terminal Emulator on Android phone. A small playground without root permission is provided to play around in Android phone.

If at all you need a root privilege better root your phone :)

How to

1. Install Termux from google play store



2. Update and Upgrade packages in Termux app

Use the cmd

pkg update

pkg upgrade


Set of packages Upgraded



3. Install OpenSSH

pkg install openssh



4. Set Termux User password 

passwd


5. Termux will accept any user name but for integrity sake

Use cmd 

whoami

6. To find the android phone IP address

ifconfig


7. Start the daemon in Termux which listens on port 8022

sshd


To check the port number

grep Port $PREFIX/etc/ssh/sshd_config

cmd printenv output above

8.  Using ssh client prg

ssh -p 8022 user@10.242.52.143



top