SSHFS is FUSE. Without allow_other the filesystem runs with the privileges of the user that ran it, and only that user can access the filesystem. In your case even root cannot access the filesystem.
Using allow_other is not recommended. There is also allow_root, see man 8 fuse and don't miss where it mentions user_allow_other configuration option.
On the other hand /dev/mmcblk0p2 is mounted by root. It's not clear what the filesystem there is. Possibilities:
If the filesystem type is supported by the kernel and if the filesystem supports UNIX permissions and ownership, these apply.
If the filesystem type is supported by the kernel but without UNIX permissions/ownership support, they are most likely fixed at the mount time for the entire mount. In such case maybe you could provide an option to specify a user to whom the mount should belong. You didn't. It most likely belongs to root and no other user can write to it.
If the filesystem type is not supported by the kernel but it's supported by a userspace program, then it gets mounted in the userspace (again FUSE). The mounting user is root, no allow_other, so only root can access it.
Anyway, only your user can access the SSHFS, but your user apparently cannot write to the other mount. Single cp run by your user or root will hit permission denied on one end or the other. Possible solutions:
- Mounting FUSE with
allow_other (not recommended).
- Mounting the SD card for your user (in case 2 or 3).
- Changing ownership/permissions (in case 1).
- Copying via intermediate location, so your user and root can both access it (you already tried this and it worked).
Using two processes: one for your user, one for root:
cat local/mount/point/file | sudo tee /other/local/mount/point/directory/file >/dev/null
This command can copy multiple files (and I mean directories as well):
tar -c -C local/mount/point file1 file2 directoryA … \
| sudo tar -x --no-same-owner -C /other/local/mount/point/directory