View Single Post
Posts: 88 | Thanked: 411 times | Joined on Mar 2010 @ southern Italy
#2109
Originally Posted by taixzo View Post
No, it does not work.
The ssh service is only enabled if the "Developer Mode" is enabled and in the Developer Tools menu of the Settings you enable the Remote Connection thing and set a password.

Then you can ssh via wifi at the specified wifi address (or USB address if you use the "Developer Mode" USB connection), something like:

ssh nemo@192.168.5.93

Fun fact: if your Linux box has a ~/.ssh/id_rsa.pub text file, you can append its contents to /home/nemo/.ssh/authorized_keys file (it has to be chmod 600 - that is, only readable/writeable to "nemo") such that you can ssh to Sailfish without being asked for the password.

This allows nice things like executing SailfishOS commands and using their output on your Linux box - say,
Code:
ssh nemo@xperia /bin/df | grep ' /home' | awk '{print $4 / 1000, "Mb"}'
to get the free space on the home partition (note that grep and awk are executed on your Linux box), without human interaction.

I enjoy using that trick to send SMS messages from command-line on my Linux box, something like sending every morning (via a systemd.timer) an automated message:
Code:
sms Boss Plz I only have `/bin/df | grep dev.sdb2 | awk '{print $4 / 1000, "Mb"}'` megs left, I need a new hard disk ASAP.
__________________

Last edited by alfmar; 2017-11-07 at 20:11.
 

The Following 3 Users Say Thank You to alfmar For This Useful Post: