2017-10-23

Installing mosh on Sailfish X

One of the awesome parts of using Sailfish OS is that you can administer your phone through ssh and sftp.
If you're using a GNU/Linux distro on your computer that can make life a lot more convenient. 



Select Settings
Select Developer Tools


Enable remote access
Simple. The next step is to check that you can connect to the phone using
ssh nemo@<your-ip>

Then disconnect, generate an ssh key if you don't have one already and copy it to the phone:

ssh-copy-id -i ~/.ssh/id_rsa nemo@<your-ip>

But there are some problems with SSH, even though the security is great as long as you know a little about RSA. If you don't, I recommend Simon Singh's The Code Book as a gentle and entertaining entry into the world of cryptography.

SSH transfers everything from the server side and does nothing to it. It's pretty dumb. That means that for instance cancelling a command with Ctrl+C will often come with a delay. It also doesn't do well with intermittent connections, because it has to catch up by sending you everything which has happened instead of just sending you the current state. Mosh is better there. See mosh.org for more.

I searched, and found this blog post from 2013 and tried running the commands half expecting the repo to be down.

ssu ar tbr-mw http://repo.merproject.org/obs/home:/dm8tbr:/branches:/nemo:/devel:/mw/latest_armv7hl/
ssu ar tbr-apps http://repo.merproject.org/obs/home:/dm8tbr:/branches:/nemo:/devel:/apps/latest_armv7hl/
pkcon refresh
pkcon install mosh


But it turns out it was fine. It installed immediately. Thanks Thomas!
So I disconnect and try to connect with

mosh nemo@<your-ip>

But as I expected it didn't work. Even though the programme is running just fine, you need to set the locale to UTF-8 first.
Ssh in again.


nano ~/.bashrc
# append the following lines
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# Ctrl+X Y to save
source ~/.bashrc
exit
!mosh # to run the same mosh command again.
 

Success!

No comments:

Post a Comment

Please pay attention to spelling and grammar. The comment field is not moderated.