Windows Terminal SSH (2024)

  • Article

Windows has a built-in SSH client that you can use in Windows Terminal. In this tutorial, you'll learn how to set up a profile in Windows Terminal that uses SSH. Note that this feature is in preview.

Access Windows SSH Client

The latest builds of Windows 10 and Windows 11 include a built-in SSH server and client that are based on OpenSSH, a connectivity tool for remote sign-in that uses the SSH protocol. OpenSSH encrypts all traffic between client and server to eliminate eavesdropping, connection hijacking, and other attacks.

By default, the OpenSSH client will be located in the directory: C:\Windows\System32\OpenSSH. You can also check that it is installed in Windows Settings > Apps > Optional features, then search for "OpenSSH" in your installed features.

Windows Terminal SSH (1)

For more information on configuring OpenSSH, see OpenSSH Server configuration for Windows.

Note

Windows Terminal version 1.XX+ can dynamically generate profiles to connect to the SSH hosts within your OpenSSH config file.

Create a profile

You can start an SSH session in your command prompt by executing ssh user@machine and you will be prompted to enter your password. You can create a Windows Terminal profile that does this on startup by adding the commandline setting to a profile in your settings.json file inside the list of profile objects.

{ "name": "user@machine ssh profile", "commandline": "ssh user@machine"}

For more information, see:

Specify starting directory

To specify the starting directory for a ssh session invoked by Windows Terminal, you can use this command:

{ "commandline": "ssh -t bob@foo \"cd /data/bob && exec bash -l\""}

The -t flag forces pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, e.g. when implementing menu services. You will need to use escaped double quotes as bourne shell derivatives don't do any additional parsing for a string in single quotes.

For more information, see:

Resources

Windows Terminal SSH (2024)
Top Articles
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 5903

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.