Windows has a built-in SSH client and SSH server which you can use in the Windows Terminal. In this article, you will be learning to set up a profile in Windows Terminal that uses SSH. This can be particularly beneficial for users managing servers remotely, such as those who are using Windows VPS hosting, where seamless and secure access to your virtual server is crucial for maintaining performance, updates, and administrative tasks. Setting up SSH through Windows Terminal ensures that you can efficiently manage your VPS without third-party applications.
Access Windows SSH Client and SSH Server
The latest builds of Windows 10 and Windows 11 include an in-built SSH server and client that are OpenSSH based. OpenSSH is a connectivity tool for remote sign-in that uses the SSH protocol. It encrypts all traffic between client and server to eliminate eavesdropping, connection highjacking, 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.
It is possible to initiate an SSH session on the command line by simply typing “ssh user@machine” and you will be prompted to enter your password. Another Windows Terminal profile can be created, which will automatically run the command line setting on startup by adding the command line setting to a profile in your settings.json file inside the list of profile objects.
JSON
{
"name": "user@machine ssh profile",
"commandline": "ssh user@machine"
}
Specify starting directory
To specify the starting directory for a ssh session invoked by Windows Terminal, you can use this command:
JSON
{
"commandline": "ssh -t bob@foo \"cd /data/bob && exec bash -l\""
}
The -t flag forces pseudo-terminal allocation that can be used to carry out arbitrary screen-based programs on a remote machine, e.g. when utilizing 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.
In conclusion, setting up SSH in Windows Terminal provides a convenient and secure way to manage remote servers, making it an ideal solution for beginners and experienced users alike. With Windows offering built-in SSH capabilities, you no longer need to rely on additional software, streamlining the process of connecting to servers, including Windows VPS hosting environments.
By following this tutorial, you’ve learned how to create and customize SSH profiles within the terminal, ensuring you have quick access to your server whenever needed. Whether you’re managing a personal project or overseeing multiple servers, using SSH in Windows Terminal enhances your workflow and provides a reliable, secure connection method.