You are not logged in.

#1 2020-02-19 10:38:31

jdn06
Member
Registered: 2010-02-01
Posts: 67

[SOLVED] Problem with Mosh

I have the same problem described in this closed bug report.
It affects only one of my laptops. It confirms that it is probably a problem with some installations, but not really a bug.
The fact is that I checked and tried lot of things and I didn't success to solve this.

  • I found nothing different in perl installed packages.

  • No difference with environment variables.

mosh --local 127.0.0.1

starts without problem.

The form which fails is like:

mosh -p 6xxxx --ssh='ssh -C -p 3xxxx' myurl

Has anyone got an idea?

Last edited by jdn06 (2020-02-20 11:44:09)

Offline

#2 2020-02-19 11:37:17

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Problem with Mosh

What does fail mean and look like? Error messages? Logs?

Locale settings?

Offline

#3 2020-02-19 11:47:52

jdn06
Member
Registered: 2010-02-01
Posts: 67

Re: [SOLVED] Problem with Mosh

Here is the complete error message:

Can't locate warnings.pm in @INC (you may need to install the warnings module) (@INC contains: /usr/lib/perl5/5.30/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.30/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.30/core_perl /usr/share/perl5/core_perl) at /usr/bin/mosh line 35.
BEGIN failed--compilation aborted at /usr/bin/mosh line 35.
kex_exchange_identification: Connection closed by remote host
/usr/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).

My locale is:

LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

Offline

#4 2020-02-19 12:12:50

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Problem with Mosh

How's the locale on machines that work? Journal? systemctl?

/usr/bin/mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).

Can you ssh into that box from where you are? Are the ports correct? Can you actually access those ports from your machine?

Offline

#5 2020-02-19 19:52:58

jdn06
Member
Registered: 2010-02-01
Posts: 67

Re: [SOLVED] Problem with Mosh

Locale on the machine which is OK:

LANG=fr_FR.utf8
LC_CTYPE="fr_FR.utf8"
LC_NUMERIC="fr_FR.utf8"
LC_TIME="fr_FR.utf8"
LC_COLLATE=C
LC_MONETARY="fr_FR.utf8"
LC_MESSAGES="fr_FR.utf8"
LC_PAPER="fr_FR.utf8"
LC_NAME="fr_FR.utf8"
LC_ADDRESS="fr_FR.utf8"
LC_TELEPHONE="fr_FR.utf8"
LC_MEASUREMENT="fr_FR.utf8"
LC_IDENTIFICATION="fr_FR.utf8"
LC_ALL=

I see a difference for LC_COLLATE=C. Could it be that?

Systemctl status shows no problem.
There is no entry in journalctl after the error and nothing that seems linked to problem.

I can use mosh to my server from the same network on an Ubuntu laptop with the same command line. That is why it doesn't seem a firewall or port problem.

Offline

#6 2020-02-19 19:55:10

jdn06
Member
Registered: 2010-02-01
Posts: 67

Re: [SOLVED] Problem with Mosh

I exported LC_COLLATE="fr_FR.utf8" to test whether there was a change, but the error seems still there.

Last edited by jdn06 (2020-02-19 21:31:34)

Offline

#7 2020-02-20 11:42:17

jdn06
Member
Registered: 2010-02-01
Posts: 67

Re: [SOLVED] Problem with Mosh

I found it. I explain it here if someone else has the same problem, as it is not easy to understand from error messages.
My problem was the use of firejail on this laptop. The command firecfg created a symlink for ssh in /usr/local/bin to use ssh with firejail by default.
Apparently, it is not compatible with mosh, but it fails with a perl error.
You can see the problem if you type:

$ which ssh
/usr/local/bin/ssh

Solution then is quite easy, you remove /usr/local/bin/ssh:

# rm /usr/local/bin/ssh

Now you will have:

$ which ssh
/usr/bin/ssh

And mosh will start.

Offline

#8 2020-02-20 15:58:50

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Problem with Mosh

Wow, local/bin overrides can be nasty and unexpected.

Offline

#9 2020-04-22 14:05:08

sowieso
Member
Registered: 2016-02-02
Posts: 9

Re: [SOLVED] Problem with Mosh

Thanks a lot. This was driving me crazy too.

Instead of removing the firejail security of ssh, here are two other options.
1. Make only mosh use non-firejail ssh.

alias mosh="mosh --ssh=/usr/bin/ssh"

2. Make a proper firejail for mosh.
Copy the ssh.profile to mosh.profile.
Remove the line that makes the trouble: 

include whitelist-usr-share-common.inc

Link mosh to firejail (or run manually):

ln -s /usr/bin/firejail /usr/local/bin/mosh

Offline

Board footer

Powered by FluxBB