4 ms·
Mosh is great, however, I don't understand why it can't safely failback to regular SSH mode. My point being if the server I am connecting to doesn't have Mosh i
by xmichael99 9y ago
Mosh is great, however, I don't understand why it can't safely failback to regular SSH mode. My point being if the server I am connecting to doesn't have Mosh installed why can't it just warn, and then proceed as a normal SSH session. E.g. if mosh is there you get the benefits of mosh, if its not there well you still got a regular ssh.
- samtregar3 9y agoSounds like a nice idea - maybe offer them a patch?
- nojvek 9y agoTo be honest I find C/C++ quite scary. I would love to get better but I had a very bad taste when I was in school. Now if this was javascript, I'd be all over it.
- deleted 9y ago[deleted]
- apostacy 9y agoI'm sure there are good security reasons. ssh is very conservative about how it is invoked.
- xmichael99 9y agoNo, it is only a terminal. mosh root@192.168.1.10 root@192.168.1.10's password: bash: mosh-server: command not found Connection to 192.168.1.10 closed. /usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?) I'm pretty sure they could just change it to execute /usr/local/bin/mosh;/bin/bash without much of an issue. As that is all it is, it is a terminal.
- geofft 9y agoMosh already negotiates an ssh connection, so I think you can do this safely - attempt to execute mosh-server, if the execution fails, open a normal shell and proxy the data back to the original screen. You probably don't want mosh to do the proxying, since ssh (the client) is a pretty involved program - it handles signals, it supports port-forwarding, etc. I sort of suspect SSH ControlMaster would work. I could imagine a mosh client script that sets ControlMaster=yes and a random ControlPath, tries to mosh, and runs ssh -o ControlMaster=no if it fails. And then unconditionally does an ssh -o ControlMaster=no -O exit.
- Gaelan 9y agoEven better: use the SSH connection to drop a statically-linked mosh-server in /tmp (or ~) and use that.
- JdeBP 9y agoDon't fall into the trap of thinking that mosh is based upon SSH, that mosh is just another SSH client. mosh is not "mosh special" SSH in place of "normal" SSH. The actual main run-time operation of mosh does not involve SSH at all. It is not even architecturally the same as SSH. mosh runs an internal terminal emulator on the server machine. SSH employs an external terminal emulator on the client machine. The terminal emulator on the server machine is the mosh-server program, which is necessary for this architecture to work. If there is no server-side program installed, part of the overall system is missing, for which SSH is not a substitute. mosh uses SSH, but merely at client startup, as a means of remotely executing the server command that it speaks to and exchanging a shared secret with it. In theory, it could even be changed to use something other than SSH for that, without changing the primary operation of the mosh client and server. (Parsing the output of a shell, including the output of whatever non-interactive startup scripts that shell may run, for a magic sequence is a somewhat rickety mechanism; reminiscent of Fidonet handshakes and Zmodem, but not done as well as they.)