less than 1 minute read

Transfer files for Android devices with Primitive FTPd server (ftp/sftp)

Download Primitive FTPd Apk

Configure Primitive FTPd

  • set a password for user (Primitive FTPd default username)
  • disable ftp server (SFTP only)
  • launch Primitive FTPd server
  • upload authorized_keys
cat <<EOF> authorized_keys
ssh-rsa ...my super secure rsa pubkey
EOF
chmod 0700 authorized_keys
sftp -P 1234 user@<ip_displayed_by_primitive_ftpd>
> mkdir .ssh
> cd .ssh
> put authorized_keys
  • enable “Authentication Public Key”
  • restart Primitive FTPd server

Configure your machine

  • mount it for test purpose (or temporarily)
mkdir $HOME/droid
sshfs -p 1234 -o idmap=user user@<ip_displayed_by_primitive_ftpd>: $HOME/droid   # mount
fusermount3 -u $HOME/droid                                 # umount
  • mount it via fstab
# in root mode
cat <<EOF>> /etc/fstab
user@<ip_displayed_by_primitive_ftpd>: /home/user/droid  fuse.sshfs noauto,x-systemd.automount,_netdev,port=1234,users,idmap=user,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect 0 0
EOF
mount $HOME/droid                                          # mount
umount $HOME/droid                                         # umount

Sources

That’ s all !

Updated: