mobile-shell / mosh

Mobile Shell
https://mosh.org
GNU General Public License v3.0
12.69k stars 741 forks source link

Mosh-server exits after closing initial SSH session #1294

Open geoff-sheldon opened 1 year ago

geoff-sheldon commented 1 year ago

On a Manjaro server and Debian Client config, the mosh client is able to SSH in, start mosh-server, then grab the connection details and exit, but when it attempts to connect via UDP nothing is received from the server.

I was able to connect by manually running mosh-server on the server, then copying the key and running mosh-client on my Debian client. However, if the session that spawned the mosh server is closed, the mosh server dies immediately. Here's how I tested the issue and arrived at this conclusion:

I believe the same is happening when I run mosh by itself, even though the mosh server reports that it is detached from the terminal session it definitely is not.

Crest commented 1 year ago

Does it make a difference if you logged into the system with an other SSH session? Do processes started with nohup/tmux/screen keep running if you logout? Has systemd been (mis-)configured to kill all processes on closing all login sessions? Are any errors written to stdout/stderr or syslog?

raduc commented 1 year ago

I had a similar issue with Siduction and the above comment helped me find that there was a line KillUserProcesses=yes in /etc/systemd/logind.conf. Commenting it out made mosh work again.

See also a similar issue: https://github.com/mobile-shell/mosh/issues/1171

Hope it helps.