With my Samsung S3 Android 4.3 everything on internal storage and microSD could be accessed remotely with ssh/scp/sftp (in Linux) to copy files to or from my phone. That was essential when I had an older Linux version that did not support MTP (on USB cable). Although, I could alternately use AndFTP client on the phone to sftp transfer files either way.
My Samsung J7 Android 6.0.1 seems more locked down. If I ssh to the phone, I have read & write permission for internal storage. But once I figured out the path to microSD, I only have read & execute permission there (no write permission). I tried to get around that and formatting the microSD as ext2 or ext4 (internal storage is ext4) to see if I could set permissions for a subdirectory, but Android said that either was "corrupted" (even though it was not).
Even Terminal Emulator or JuiceSSH apps on the phone connected as local terminals (not through ssh) had the same permissions (write for internal vs. no write microSD).
AndFTP on phone can delete or sftp download files to microSD, but only if the microSD is configured as home for that connection. If configured with home in internal storage, it cannot delete or download in microSD path.
The only app that can copy files between internal storage and microSD is Samsung's MyFiles.
Some Android versions can combine internal and external storage as one volume, but Samsung and LG chose not to do that due to problems you could run into if the microSD was removed or you wanted to swap it for a different (bigger) one.
So I was wondering if there is an sshd (ssh server) app that has write permission for microSD?
My Samsung J7 Android 6.0.1 seems more locked down. If I ssh to the phone, I have read & write permission for internal storage. But once I figured out the path to microSD, I only have read & execute permission there (no write permission). I tried to get around that and formatting the microSD as ext2 or ext4 (internal storage is ext4) to see if I could set permissions for a subdirectory, but Android said that either was "corrupted" (even though it was not).
Code:
efflandt@msata512-1610:~$ ssh -p 2222 172.16.0.137
user@j7eltetmo:/storage/emulated/0/ssh $ ls -l
-rw-rw---- root everybody 404 2017-01-23 02:28 authorized_keys
-rw-rw---- root everybody 279 2017-01-31 21:21 dropbear.err
-rw-rw---- root everybody 6 2017-01-31 21:21 dropbear.pid
-rw-rw---- root everybody 243 2017-01-23 00:40 dropbear_ecdsa_host_key
-rw-rw---- root everybody 1766 2017-01-26 02:44 id_rsa
-rw-rw---- root everybody 404 2017-01-26 02:44 id_rsa.pub
-rw-rw---- root everybody 64 2017-01-31 21:17 internal-storage.txt
user@j7eltetmo:/storage/emulated/0/ssh $ cat internal-storage.txt
Internal storage whether path is /storage/emulated/0 or /sdcard
user@j7eltetmo:/storage/emulated/0/ssh $ cd /sdcard/ssh
user@j7eltetmo:/sdcard/ssh $ ls -l
-rw-rw---- root everybody 404 2017-01-23 02:28 authorized_keys
-rw-rw---- root everybody 279 2017-01-31 21:21 dropbear.err
-rw-rw---- root everybody 6 2017-01-31 21:21 dropbear.pid
-rw-rw---- root everybody 243 2017-01-23 00:40 dropbear_ecdsa_host_key
-rw-rw---- root everybody 1766 2017-01-26 02:44 id_rsa
-rw-rw---- root everybody 404 2017-01-26 02:44 id_rsa.pub
-rw-rw---- root everybody 64 2017-01-31 21:17 internal-storage.txt
user@j7eltetmo:/sdcard/ssh $ cd /storage/0000-0000/ssh
user@j7eltetmo:/storage/0000-0000/ssh $ ls -l
-rwxr-xr-x root everybody 404 2017-01-23 00:36 authorized_keys
-rwxr-xr-x root everybody 1766 2017-01-23 00:25 id_rsa
-rwxr-xr-x root everybody 404 2017-01-23 00:25 id_rsa.pub
-rwxr-xr-x root everybody 128 2017-01-31 21:20 microSD.txt
user@j7eltetmo:/storage/0000-0000/ssh $ cat microSD.txt
Path of microSD is /storage/(UUID) which might be /storage/0000-0000 with
default formatting if you did not format it yourself.
Even Terminal Emulator or JuiceSSH apps on the phone connected as local terminals (not through ssh) had the same permissions (write for internal vs. no write microSD).
AndFTP on phone can delete or sftp download files to microSD, but only if the microSD is configured as home for that connection. If configured with home in internal storage, it cannot delete or download in microSD path.
The only app that can copy files between internal storage and microSD is Samsung's MyFiles.
Some Android versions can combine internal and external storage as one volume, but Samsung and LG chose not to do that due to problems you could run into if the microSD was removed or you wanted to swap it for a different (bigger) one.
So I was wondering if there is an sshd (ssh server) app that has write permission for microSD?