Skip to content

Instantly share code, notes, and snippets.

@Eskuero
Last active June 7, 2019 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eskuero/2074f36ea85248062c56064fa0c969df to your computer and use it in GitHub Desktop.
Save Eskuero/2074f36ea85248062c56064fa0c969df to your computer and use it in GitHub Desktop.
rsync from desktop to andorid (termux)

Inside termux on Android:


  1. Install the required packages
    $ apt install openssh rsync
    
  2. Add a password for the termux user
    $ passwd
    
  3. Get the termux username
    $ whoami
    
  4. Run the ssh daemon
    $ sshd
    

On your desktop:

  1. Generate your ssh key if you don't have one already.
    $ ssh-keygen
    
  2. Add your key to the termux authorized keys
    $ ssh-copy-id TERMUXUSER@ANDROIDIP -p 8022
    
  3. 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"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment