Skip to content

Instantly share code, notes, and snippets.

@iAmG-r00t
Last active November 14, 2024 17:59
Show Gist options
  • Save iAmG-r00t/31137842e8923e6fdedff9a460401243 to your computer and use it in GitHub Desktop.
Save iAmG-r00t/31137842e8923e6fdedff9a460401243 to your computer and use it in GitHub Desktop.
Windows Terminal + WSL + MOSH + Remote Server == SSH Tab Profile in Windows Terminal
  • Hi, so I was looking for a way to configure windows terminal to have a profile that automatically logins to a remote server using mosh.

  • I ended up here, but it wasn't a reliable method for me.

  • Below is how I managed to do it.

  • First make sure the requirements are present, WSL, Windows Terminal and an installed distribution of your choice ( preferably Ubuntu).

  • Next proceed; installing mosh and ssh in the wsl distribution of your choice.

  • Next create an SSH Key that is not password protected and then add it to your remote server.

  • Also do remember to install mosh in the remote server.

  • Next within your wsl distribution, create the ~/.ssh/config file and then add the following;

    HostName RemoteServer
      HostName `$remote_ip`
      User `$remote_username`
      IdentityFile ~/path/to/private/key/file
  • Restart SSH.

  • Test the connection from terminal; mosh RemoteSerer

  • If it works add the following line to the windows terminal config file;

    "commandline": "wsl -d Ubuntu-20.04  mosh RemoteServer",
    • Now you are good to go.
@lifei
Copy link

lifei commented May 10, 2023

No need.

  1. Go to project fluent terminal, and just clone it to local disk. you will find a file named mosh-client.exe.
  2. Install mosh on a linux machine. copy the file with path /usr/bin/mosh. it's a perl script.
  3. put them in your PATH, you would use mosh on Windows natively.

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