Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Tutorial: SSH in Windows Terminal

Feedback

In this article

Windows has a built-in SSH client and SSH server 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 and SSH Server

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 and OpenSSH server are located in the directory:C:\Windows\System32\OpenSSH. You can also check that it is present in Windows Settings > System > Optional features, then search for "OpenSSH" in your added features.

ssh_optionalfeature

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

Create a profile

You can start an SSH session in your command prompt by executingssh 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 thecommandline setting to a profile in yoursettings.json file inside thelist 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

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?