Sunday, July 8, 2018

ssh - Set hostname for SSHelper


I currently use SSHelper to transfer my data to the Android 4.0 device. The app displays the IP address that is currently assigned. Since this IP address changes regularly, I'd like to use a hostname for the device, with all my Linux computers, that works with Avahi/Zeroconf and I have computername.local.


How do I get such a hostname for my Android device?



Answer



I am leaving my old answer since the browse and parsing examples may still be useful for some people.


Thanks to the developer's version 5.5 update to SSHelper, you can create a user defined name to be the phones Zeroconf instance name. SSHelper will run the SSH server on a non-rooted Android.




  1. Update SSHelper to version 5.5

  2. Open Android Bluetooth settings and turn on Bluetooth.

  3. Now in lower right corner there is settings to "Rename phone". Customize the name.

  4. Turn off Bluetooth if you want.

  5. Restart SSHelper.


It will register the Bluetooth name as the ZeroConf name. Now, as long as the machine you are connecting from has the avahi/bonjour client software, you can ping, ssh, sftp, or rsync to PhoneName.local. If you do not change your Bluetooth name, it will default register with the Device model name. e.g. "Nexus_4"


# For example:
ping Nexus_4.local

SSH Nexus_4.local

No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...