This sets up a USB gadget with three functions - serial, ethernet and mass storage (with /dev/sda being exported). Make sure to unmount any SD partition before doing that though - it is a block level export (as opposed to other tech like MTP that exports things on a filesystem level), so it will be your PC that will mount these partitions on its own!
Over time, if looking to gain mainstream customers, I think MTP (or something functionally equivalent) is needed. Users of other phones have come to expect plugging in via USB as an option, and for it to work seamlessly out-of-the-box. USB has the advantage of better physical security (but watch out for “bad chargers”).
As you imply, MTP is safer than USB mass storage class because while some users will know to umount first if using mass storage class, many will not.
For me it’s rsync which comes without thinking , which means I need ssh server running in the background
What would be awesome is to have an option to activate/deactivate SSH in the settings (if installed) !
Else, I will probably have 2 shortcuts, one to disable sshd, one to activate sshd (as I have on my actual pc)
I’m planning on setting something up where whenever my home Wifi connects, mount my home server’s storage drive via NFS.
When Wifi disconnects, unmount.
I can browse the same drive via SMB on my Android but having this setup I think will be pretty slick.
Still need a good adaptive GUI file manager option though, but that is coming.
True story! A few years ago, Asus routers that had built-in USB/FTP/Samba were compromised because there was no password protection included. They’ve corrected that now. Still maybe not the best option, as you and others have pointed out.
You probably need to clarify whether your intention is that the phone is the server and offers its files to the network, or your phone is the client and accesses files on your network.
If I had to take a guess, I would say that if Samba works at all then it will work either way, and that Samba will work, but better than guessing is testing.
Note that all those people talking about sshfs (so far) are talking about “phone as server”, and “phone as server” may be good for ad hoc transfers via the network. (That said, I don’t see any reason why the phone can’t use sshfs i.e. phone as client.)
One advantage of “phone as server”, if you don’t have an external monitor / dock available and set up, is that you can use the bigger screen GUI of the desktop/laptop to drive the transfer process. Even if using the command line, you may prefer to drive from the desktop/laptop.
At the same time, if you already have a file server then for sure I can see that you might want the “phone as client” to access content available on your network.
I have (just about) all the protocols that have been discussed in this topic in use and working with other devices on my network, so happy to test everything and report back, come the day early in the new year when I have my phone (talking it up ).
I’ve been a fan of rsync for a very long time. It really pays off for updates of large files and for syncing directories where some files are new or changed and others are unchanged.