Skip to content

Mosh doesn't work with socket activated SSH #399

Closed

Description

@niklas88

When running ssh socket activated e.g. by using systemd with "enable sshd.socket" mosh can't establish a connection and times out waiting for an answer.
This seems to be the same problem as reported in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=686956
but I failed to find an issue with "sslh" mentioned on github

Activity

  1. keithw commented on Mar 10, 2013

    @keithw
    Member

    Interesting. Can you run ssh SERVER 'echo $SSH_CONNECTION' and paste the result? I'm curious whether systemd is also causing sshd to become confused as to the client's IP address.

  2. keithw commented on Apr 30, 2013

    @keithw
    Member

    Most likely fixed in 4792992 with the --bind-server=any option.

  3. bharrisau commented on Jul 12, 2015

    @bharrisau

    Sorry for bringing an old issue up. I've been looking into this for CoreOS, the issue is that systemd will default to killing everything when the sshd socket is closed. Which means mosh-server will output the connect line, but be killed before mosh-client can connect to it.

    The solution is to change KillMode to process so only the sshd process is closed when the socket is closed.

    Edit: This is not a bug in mosh.

  4. jamespinkerton commented on Jul 12, 2017

    @jamespinkerton

    Hi. I'm getting the same problem. I tried to add the --bind-server=any and it didn't work.

    I ran the following command:
    mosh --bind-server=any --ssh="/usr/bin/ssh -i ~/.ssh/google_compute_engine.pub" james_c_pinkerton@$IP_ADDRESS

  5. reuben commented on Apr 2, 2018

    @reuben

    For others running into this issue, a way I found for working around this problem without changing the sshd configuration is by using --server="systemd-run --scope --user mosh-server".

  6. kecsap commented on Sep 11, 2018

    @kecsap

    My systemd kills screen and mosh sessions associated to ssh, but only on one Ubuntu machine where KDE Neon is installed. In my case, mosh only worked with this option: --server="sudo systemd-run --scope sudo -u USERNAME mosh-server" where USERNAME is my login username and it can execute commands with sudo without password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions