[mosh-users] Able to SSH, but not mosh

Fabian Kurz fabian at fkurz.net
Mon Jan 18 04:14:36 EST 2021


On Mon, Jan 18, 2021 at 02:33:49PM +0530, Divyanshu Agrawal wrote:
> I'm able to SSH into my college's CS server, using
> ssh -p 51346 username at ip
> and then entering password on prompt.
> But using
> mosh -p 51346 username at ip
> does not do anything, and there is no output, and the command appears
> to hang. What am I doing wrong?

If the first command works (ssh), it means that the ssh port of the
target machine is 51346, so far, so good.

In the second command (mosh) you try to connect with a mosh server on
UDP port 51346 on the destination machine.

>From mosh's help (mosh --help)

| Usage: /usr/bin/mosh [options] [--] [user@]host [command...] ...
| -p PORT[:PORT2]
|         --port=PORT[:PORT2]  server-side UDP port or range
|                                 (No effect on server-side SSH port)

What you probably want to do is described a few lines later in the
help message: 

| --ssh=COMMAND        ssh command to run when setting up session
|                      (example: "ssh -p 2222")
|                      (default: "ssh")

So please try:

mosh --ssh="ssh -p 51346" username at ip

BR,
Fabian

-- 
Fabian Kurz, DJ1YFK      Munich, Germany
fabian at fkurz.net         +49(174)6926713
https://fkurz.net/       Go Vegan! ☮ 


More information about the mosh-users mailing list