How to use a new Windows Terminal app for SSH?

Himura picture Himura · Aug 5, 2019 · Viewed 30.7k times · Source

The Windows Terminal app is advertised as a central hub for all terminal work, so I'm interested in a way to bring my SSH connections into it and replace ancient PuTTY.

Answer

Himura picture Himura · Aug 5, 2019

You can use a commandline field in your profile configuration to initiate an SSH connection on tab creation.

Step-by-step guide:

  1. Ensure you have an SSH client (try to connect to the server from a Command Prompt tab). @dhgouveia2's post details this step.
  2. Open Settings (Ctrl+,)
  3. Find the "list" array in the "profiles" object
  4. Find a Command Prompt profile ("commandline": "cmd.exe")
  5. Duplicate the profile (copy-paste the whole object, watch for the comma between objects)
  6. Change the "guid" value to a new GUID (for example, from here)
  7. Change the commandline value to "commandline" : "ssh me@my-server -p 22 -i ~/.ssh/id_rsa" (use your own connection command).
  8. Change the profile's "name"
  9. Add an "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png" item to use a Tux icon (default icons are here)
  10. You should have something like this:
    {
        "$schema": "https://aka.ms/terminal-profiles-schema",
        "profiles":
        {
            "list":
            [
                // ...
                {
                    "guid": "{1d43c510-93e8-4960-a18b-e432641e0930}",
                    "name": "ssh my-server",
                    "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
                    "commandline": "ssh me@my-server -p 22 -i ~/.ssh/id_rsa"
                }
            ]
        }
    }
    
  11. Save the configuration and enjoy the new item in the New Tab drop-down.