This tutorial shows how to start an SSH terminal session under Windows, using connection with OpenSSH and Windows Terminal. Prerequisite is that the OpenSSH Client is installed on Windows. Windows Terminal can be found as an app in the Microsoft Store. After downloading, the Windows Terminal can see as wt.exe under the application settings path LOCALAPPDATA.
%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe
Windows Terminal has evolved and can be measured against modern terminals of other operating systems, such as the GNOME Terminal. It can also be seen with the well-known terminal tools under Windows, such as PuTTY and KiTTY.
Install OpenSSH on Windows, select from Apps & Features – Optional Features – Add Feature – OpenSSH Client.
A new host can be set up in the settings page with hit Ctrl+,
The host entry is added in the Windows Terminal Settings (Ctrl+,) with Add New Profile.
Just fire up and connect to the new added host.
Tip! Keys generated with ssh-keygen can be used SSH sessions without entering a password and even more securely.
SSH connection using OpenSSH in Windows Terminal
To do this, create the folder.ssh
under the home path %USERPROFILE%, in which private and public keys are stored. Then creating the fileconfig
in this the hosts are added and configured, with the assignment of host name and the appropriate private key.
Host vm126
HostName 10.10.0.11
User james
IdentityFile ~/.ssh/id_rsa
ServerAliveInterval 60
The public key (id_rsa.pub) is stored on the remote host at ~/.ssh/authorized_keys
theconfig
file offers many options for configuring ssh targets so that they can be started easily in the Windows Terminal CLI.
You might also be interested in this related post here.
Nice.
As a hint. I use ssh-agent to manage my ssh keys:
Start ssh-agent service:
By default the ssh-agent service is disabled.
As an Administrator
PS> Get-Service ssh-agent | Set-Service -StartupType Automatic (delayed)
Start the service
PS> Start-Service ssh-agent
Add public key
Load your key file into ssh-agent:
PS> ssh-add \
Hmm, the comment system swallowed my argument placeholder.
ssh-add of course needs the path to key file which afterwards does no have to be on the machine anymore.
Thanks for the hint which is a good addition, anyway i want to celebrate in this post that ssh on windows can now be used in the same way with ssh-key handling as it is the default on linux, which is not self-evident. However, this is only my opinion!
Na, you are right. Just wanted to complement it.