4 ms·
A long time ago, when I tried something like that, I was stymied because the SSH server did not have permissions to write to any directory which the document re
by adrianratnapala 8y ago
A long time ago, when I tried something like that, I was stymied because the SSH server did not have permissions to write to any directory which the document readers etc. could see.
Is this sort of thing still a problem? How did you get around it?
- rl3 8y agoIt was never an issue for me. Giving the SimpleSSHD docs a quick glance, the app itself does not operate as root, although its packaged subcomponents like rsync optionally can depending on what shell you point them to. My phone isn't rooted. Everything in /storage/emulated/0 backs up without issue. Obviously not a full system backup, but all my data none the less. With regards to write permission, I've only ever issued any writes to my image folders to prune photos or screenshots older than xx days that have already been backed up. On that note, freeing up 20GB of space instantly with a single command is incredibly satisfying (compared to the MTP hell alternative).
- CapacitorSet 8y agoIf you only need a shell, adb does that, as well as blazing fast file transfer (for the standards of MTP).
- rl3 8y agoFor sure, although I think it isn't as well suited to being a remote daemon. With SimpleSSHD, all concerns are compartmentalized into an app, you get rsync out of the box plus a nice minimalist UI for monitoring. Then adb can be left disabled, and its configuration untouched.
- CyberShadow 8y agoIf your phone is rooted, you can use e.g. Linux Deploy to install a full Linux distribution. Then, you can set up regular ol' OpenSSH, mount /sys and /data under the Linux chroot, and rsync as usual. I use this method to rsync to btrfs snapshots (+ raw copies of non-filesystem partitions) to make daily incremental backups of the entire phone. (Restoring said backups is a bit more involved, but I verified it's doable.)
- paulie_a 8y agoI'd backup to a more reliable filesystem than btrfs. In my experience you will eventually randomly lose data with btrfs. I have lost all trust in it.
- dokument 8y ago"raid" 1/0 and 10 are stable, others are not. Theoretically btrfs can protect against bit-rot where other fs's typically don't.
- paulie_a 8y agoTheoretically that might be the goal. In my experience data melts away like butter on btrfs.
- CyberShadow 8y agoBackups are by definition redundant, however, btrfs is still the only Linux filesystem with its featureset. Let me know when ZFS on Linux supports shrinking or cloning file ranges. https://news.ycombinator.com/item?id=16494370 https://news.ycombinator.com/item?id=16494370
- tjoff 8y agoI haven't used SimpleSSHD but I use Termux, which gives me a "normal" terminal (no root required). Since Android 8 I've lost write access to general locations in the sd-card but I still have read access, as well as read+write on the internal storage. It has an ssh server which can be nice if you want to edit some files on the phone remotely but that's not needed for rsync. I have a shortcut on the home screen which triggers a script that runs an rsync command for photos and other stuff I want to backup. Also use it to reverse-sync a folder from my NAS, want to send a file to the phone? But the file in that folder and run the script.
- pozibrothers 8y agoI think that you need to run the command "termux-setup-storage" to be able to r/w again: https://wiki.termux.com/wiki/Termux-setup-storage https://wiki.termux.com/wiki/Termux-setup-storage
- tjoff 8y agoThanks, doesn't work though. I have write access to the private directory for termux on the sdcard but nothing else (which unfortunately breaks my usage, I'll report it to them any day to see if a fix is possible).
- sedlav 8y agoThis is the way Termux works so far, External storage: Storage on external SD cards. Each app has a private folder on the external SD card, and interchange between them needs to use a special API not yet available in Termux. https://wiki.termux.com/wiki/Internal_and_external_storage https://wiki.termux.com/wiki/Internal_and_external_storage
- tjoff 8y agoIt worked fine in Android 7, when I updated to 8 my scripts started getting permission-denied errors on writes. I don't see anything in that link that says that sdcard (outside private folder) is read-only. The way I read "Each app has a private folder on the external SD card, and interchange between them needs to use a special API not yet available in Termux." is that I can't read another applications private folder, but I'm not trying to - I just want (write+delete) access to the publicly accessible parts of the sdcard (lots of other applications do this, and termux did in Android 7).
- trumped 8y agoThis is an Android problem that is sold as a feature by Google... still a problem on my version of Android (in Android 5.0 and later, an app can request the permission for reading/writing to a folder on the SD card though: https://metactrl.com/docs/sdcard-on-lollipop/ https://metactrl.com/docs/sdcard-on-lollipop/ )