RemoteFiles icon indicating copy to clipboard operation
RemoteFiles copied to clipboard

SFTP service discovery and easy connection

Open drakkan opened this issue 6 years ago • 3 comments

Hi,

I'm the author of the SFTP Server SFTPGo (https://github.com/drakkan/sftpgo).

Recently some users asked for a portable mode, in SFTPGo, that allows to easily share files between pc and mobile devices:

https://github.com/drakkan/sftpgo/issues/51

I'll add basic support for this soon.

As you can see in the bug report my users asked for a way to easily estabilish a connection from the mobile device, for example a QR Code or something similar.

I think that for implement this feature I need to agree a protocol with an app.

I think an easy way could be:

  1. SFTPGo advertises the service using multicast dns,
  2. Your app should search for sftp services and let the users connect.

I'm open to other solutions too, I prefer an open protocol and no a proprietary one.

Are you interested to add this feature to your app?

Thanks!

drakkan avatar Oct 24 '19 16:10 drakkan

Thanks for considering my app for this :) I would like to add this feature. I could probably use this plugin and this example to discover the sftp service, but I don't know which domain name I would have to use (maybe something like _ssh.local?). Do you know which domain name I have to use?

nn1ks avatar Oct 24 '19 18:10 nn1ks

Hi,

great news, thanks!

I think the domain name should be _sftp-ssh._tcp

https://github.com/lathiat/avahi/blob/master/avahi-daemon/sftp-ssh.service https://kodi.wiki/view/Avahi_Zeroconf#SFTP_service_.28.2Fetc.2Favahi.2Fservices.2Fsftp.service.29

I'll do some experiments the next weekend and I'll test the interoperability with android/java using this code

https://developer.android.com/training/connect-devices-wirelessly/nsd

drakkan avatar Oct 25 '19 01:10 drakkan

Hi,

I implemented the multicast dns on my side, discovery from Android works using the java API: for a bug in java code the TXT record that can contains credentials cannot be read:

https://stackoverflow.com/questions/25984894/android-mdns-txt-record

drakkan avatar Oct 26 '19 16:10 drakkan