18

I would like for my Android device (a Samsung Galaxy) to be discoverable through avahi/bonjour when it is connected to a WiFi network, and then to be able to access its filesystem via SSH (SFTP).

For me, that's a familiar and convenient way to access various devices in my local network: to discover their SSh service via avahi/bonjour (not to have to deal with IP addresses), and to ssh to them. I would use this way for my GNU/Linux systems (like Ubuntu).

Is there free (= libre -- because I appreciate the freedom of hacking) software for Android that would implement this, namely:

  • avahi/bonjour support for Android, so that the Android device would be reachable by name in the .local domain (instead of just by its IP address);
  • and an SSH server with support for publishing itself through Avahi/bonjour (mdnssd).
6
  • Just the same wish -- android.stackexchange.com/questions/20907/… : to ssh to Android not by its IP, but rather by the name acquired via zeroconf/bonjour/avahi/mdns (whatever you call it). It would be even better if the SSH service would be published via zeroconf/bonjour/avahi/mdns/dnssd (whatever you call it). Commented Aug 13, 2012 at 13:02
  • As for the SSH part of the wish, there are already Q&As: android.stackexchange.com/questions/9905/… , android.stackexchange.com/questions/15503/… . (Although I'll have to find out whether the suggested solutions are free/libre software--to answer my question.) The avahi/bonjour/zeroconf support part of my question is without an answer though... Commented Aug 13, 2012 at 13:08
  • 2
    I know it's not the same, but while searching for the "final solution": I advised my routers DHCP to assign the devices a static IP, and then configured that with my local DNS (you could also do so via /etc/hosts). So I don't have to remember IPs, but the devices "nick names", which is quite easy in comparision.
    – Izzy
    Commented Aug 13, 2012 at 13:45
  • @Izzy: I see, thanks, that's a very reasonable workaround. But unfortunately, in my case, it seems that I have (as the router) an Airport Extreme basestation which doesn't support "DHCP reservations". Also, it would be nice to be able to connect to the device by a "nickname" in the situation when I'm a "guest" (in a network not configured by me). Commented Aug 13, 2012 at 14:22
  • 2
    Sure, that was understood from the beginning -- that's why I thought it as a work-around undtil you find a real solution. There are apps available permitting you to configure a "fixed IP on demand / by network" (as opposed to the "fixed DHCP"), which should even work with your extreme airport basestation. If you're interested, I could sum this up and place it in an answer (together with my above comment).
    – Izzy
    Commented Aug 13, 2012 at 14:37

1 Answer 1

4

I have been using the free SSHelper (without rooting) since it recently added zeroConf broadcasting. It provides an SSH and RSYNC (file transfer) server, while also broadcasting a ZeroConf name. Another avahi/bonjour client can connect without needing to know the android hostname. Explained in more detail in this other answer: Set hostname for SSHelper

6
  • Thanks alot for the information! Now at least I know of one possibility to set this up. I prefer to use free software (= libre, open-source). Should I consider SSHelper then?.. (I don't know yet whether it is free software.) Commented Jan 3, 2014 at 22:53
  • @glenschler Hi, I've just tried SSHelper but I haven't figured out how to connect o ssh using the name. I've checked out the source code and it seems to use "SSHelper" as the zeroconf name, but I can't connect to it like so: ssh SSHelper:2222. Any hints/tips ? Thanks Commented Feb 11, 2014 at 15:33
  • @george-profenza I did not know the source code was available. I'll need to investigate. You should browse your network for all "avahi" names. This will be different from your mac or linux machine. android.stackexchange.com/questions/42358/…
    – glenschler
    Commented Feb 12, 2014 at 17:53
  • @glenschler I've used avahi on a Raspberry Pi and after installing it I could access my pi as rpi.local. On windows I had to install the bonjour service. I did try to access ssh/http use the SSHelper hostname (which I could see listed on a mac running dns-sd -B) but I couldn't connect to it. How do you connect to your phone by name(what name do you use) with SSHelper ? Commented Feb 18, 2014 at 1:10
  • 1
    There is a new version 5.5 of SSHelper. Yes, to answer the previous question, it is free software. You can now configure a custom name! My instructions are detailed here android.stackexchange.com/questions/42358/…
    – glenschler
    Commented Mar 31, 2014 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .