Could someone please create a clean and easy-to install mosh package on SFOS, perhaps into the Chum build system? Some older installation sets exist, but they seem to suffer from dependency issues with newer SFOS.
Seems it ships a decent RPM spec, and isn’t overly complex in what it needs, so i messed around a bit.
I can get it building with:
sfdk tools package-install SailfishOS-4.4.0.58-aarch64.default autoconf
sfdk tools package-install SailfishOS-4.4.0.58-aarch64.default automake
sfdk build-shell ./autogen.sh
sfdk --specfile fedora/mosh.spec build
The first three steps can be omitted if you build from a release, but for whatever reason they don’t have the rpm spec included there instead.
If sfdk complains about “The command needs to be used from the top of the build tree”, you need to do sfdk build-init
.
Don’t ask me why. Since if the “fix” is so trivial i cannot for the life of me understand why it is not automatic.
It will be interesting to learn what this translates to as a properly packaged chum version.
A shame no volunteers to do this have turned up. It really doesn’t look like a major project.
Can you elaborate what the advantages of using mosh
on the phone (as opposed to on the device connecting to the phone) are?
Would mosh
also replace sshd
on the device, or is it only for connecting from the phone?
I’m mainly thinking of a mosh client here.
Mosh is started up as a standard tcp/ip ssh connection, but once keys have been exchanged and the protocol has been initiated, it works over a tcp/udp connection. Mosh maintains its session even when it “roams” (when the client endpoint changes to different IP addresses) which is just what you need on a mobile device.
Thanks. I had considered using mosh many times and it definitely makes sense as a client on the phone itself.
Do you know if it also makes sense on local computers connecting to the phone?
A mosh server needs to be able to receive and send out tcp/udp packages on a range of ports, this might not be available for a mobile device in all environments.
I’ve had experiences where eg. hotel wifi filters out pretty much everything except the very common tcp/ip ports (80, 443, 22,…) and allows only the tcp/udp port 53 you need for dns to work.
@nephros kindly built a test installation of mosh, which is currently available for aarch64 with:
ssu ar mosh-testing https://repo.sailfishos.org/obs/home:/nephros:/devel:/mosh/sailfish_latest_aarch64/
pkcon refresh
pkcon install mosh
It has also been submitted to chum:testing
, so this repo will at some point go away. I’ll mark this down as an answer, thanks again to @nephros!
Note that as haven’t used mosh myself before, so I haven’t been able to test a lot. But @ExTechOp reports it as working so…
You can also do
pkcon install mosh-server
To install the server on the device. This will also add a rule to the firewall to allow incoming connections (udp/60000:61000
) while on Wifi. The server itself will have to be started manually though.
Take care that no other apps are listening on that port range while on an untrusted network!! Edit or remove /etc/connman/firewall.d/99-mosh-firewall.conf
to disable this.
Once mosh appears in Chum, do
ssu rr mosh-testing
pkcon refresh
to remove the test repo again.
Also, because of vendor changes, you will have to uninstall the test version before being able to install the Chum version:
pkcon remove perl-IO-Socket-IP
pkcon remove mosh
pkcon remove mosh-server
… and it has landed in chum:testing!
Sorry but I need to ask again: does mosh not require to be installed on both sides of the connection?
edit: Yes
Yea.
The server package is for when you want to mosh from somewhere into your phone.
Well, consider me a convert. Ssh sessions surviving a network switch from wifi to mobile net? Cool, cool, cool!
In addition to the mosh service you will need some method to be able to find the outward-facing IP address of your device when it changes. Some form of dynamic name server comes to mind.