- Install the required packages
$ apt install openssh rsync - Add a password for the termux user
$ passwd - Get the termux username
$ whoami - Run the ssh daemon
$ sshd
- Generate your ssh key if you don't have one already.
$ ssh-keygen - Add your key to the termux authorized keys
$ ssh-copy-id TERMUXUSER@ANDROIDIP -p 8022 - Test the setup by syncing a certain folder to the phone
$ rsync -av /localfolder/music TERMUXUSER@ANDROIDIP:/storage/emulated/0/Music --info=progress2 -e "ssh -p 8022"