ssh and rsync for Android, Termux

I used SSHelper for some time to rsync my files from my Linux machine to Android phones, see here. I most notably used this for transfering photos. I now user Termux. I prefer Termux over SSHelper as it allows to install new programs within Termux using pkg oder apt-get.

Starting Termux looks like this:

For transfering files from PC to phone I start sshd from package openssh on phone:

sshd -p2223

For transfering files from phone to PC I just scp. To quickly start or stop sshd I use some aliases, e.g.,:

alias s='sshd -p2223'
alias sk='pkill sshd'
alias sn='ssh klm@N'

So I just type s to start sshd, I type to stop the sshd-daemon, and so on. Needless to say that when you offer some network service, like sshd, you must instruct your router to provide proper port forwarding so that PCs, which are usually using LAN, can then access WLAN services, which are usually in another subnet. Also you should set fixed IP addresses for this particular phone.

There is one catch one has to be aware of: One needs to activate file access!

This file access activation is required for example to access photos, which are usually stored here

/mnt/sdcard/DCIM/Camera

Screenshots are usually stored here:

/mnt/sdcard/Pictures/Screenshots

There is a Wiki for Termux here. Termux was written by Fredrik Fornwall.

One thought on “ssh and rsync for Android, Termux

  1. Pingback: youtube-dl HTTP 403 error – Elmar Klausmeier's Weblog

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.