Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr3638 :: Ken drops a bear on his android phone

How to enable sftp using a sshd server on android/lineageos

<< First, < Previous, , Latest >>

Thumbnail of Ken Fallon
Hosted by Ken Fallon on 2022-07-13 is flagged as Clean and is released under a CC-BY-SA license.
SimpleSSHD, SSH2, dropbear, android, lineageos, primitive ftpd. (Be the first).
The show is available on the Internet Archive at: https://archive.org/details/hpr3638

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:05:16

general.

I have previously used https://f-droid.org/en/packages/org.primftpd/ to enable sftp to my android phone

For more information on How to mount remote storage using sshfs, see hpr1944 :: sshfs - Secure SHell FileSystem

Also you will need to know about some useful tools for working with Android Devices hpr3515 :: ADB and scrcpy

simplesshd-icon

I found https://www.galexander.org/software/simplesshd/

SimpleSSHD is an SSH2 server based on dropbear that supports scp, sftp, and rsync. It only supports public-key based authentication (no password/interactive auth except for bootstrapping). It does not use root, which means it must listen on a port over 1024 (defaults to port 2222).

Install from fdroid

https://f-droid.org/en/packages/org.galexander.sshd

Start Screen

Changing Port Number

Changing Path

before

laptop$ adb root
laptop$ adb shell
phone: # cd /data/user/0/org.galexander.sshd/files
phone:/data/user/0/org.galexander.sshd/files # ls -al
total 56
drwxrwx--x 2 u0_a268 u0_a268 4096 2022-06-17 12:06 .
drwx------ 6 u0_a268 u0_a268 4096 2022-06-17 11:59 ..
-rw-rw-rw- 1 root    root     490 2022-06-17 12:05 authorized_keys
-rw------- 1 u0_a268 u0_a268  475 2022-06-17 12:07 dropbear.err
-rw------- 1 u0_a268 u0_a268  650 2022-06-17 12:03 dropbear.err.old
-rw------- 1 u0_a268 u0_a268    6 2022-06-17 12:06 dropbear.pid
-rw------- 1 u0_a268 u0_a268   83 2022-06-17 12:03 dropbear_ed25519_host_key

Commands to run

phone:/data/user/0/org.galexander.sshd/files # restorecon -F authorized_keys
SELinux: Loaded file_contexts
phone:/data/user/0/org.galexander.sshd/files # chmod 600 authorized_keys
phone:/data/user/0/org.galexander.sshd/files # chown u0_a268:u0_a268 authorized_keys

after

phone:/data/user/0/org.galexander.sshd/files # ls -al
total 56
drwxrwx--x 2 u0_a268 u0_a268 4096 2022-06-17 12:06 .
drwx------ 6 u0_a268 u0_a268 4096 2022-06-17 11:59 ..
-rw------- 1 u0_a268 u0_a268  490 2022-06-17 12:05 authorized_keys
-rw------- 1 u0_a268 u0_a268  475 2022-06-17 12:07 dropbear.err
-rw------- 1 u0_a268 u0_a268  650 2022-06-17 12:03 dropbear.err.old
-rw------- 1 u0_a268 u0_a268    6 2022-06-17 12:06 dropbear.pid
-rw------- 1 u0_a268 u0_a268   83 2022-06-17 12:03 dropbear_ed25519_host_key

laptop$ sshfs -p 2222 192.168.1.123: /mnt/phone/

Comments

Subscribe to the comments RSS feed.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
What is the HOST_ID for the host of this show?
What does HPR mean to you?