Windows Terminal SSH connection from KeePass


This tutorial shows how to deploy and use SSH from the Windows Terminal on Windows 11, using the KeePass Password Manager.

Add KeePass URL Override Scheme

In the first step with launch KeePass, a schema element for URL Override is created in KeePass, go to Tools – Options.

SSH Windows KeePass Click Tools Options

Click the Integration tab, then the URL Overrides button at the bottom.

SSH Windows KeePass Options Integration

In the URL Override window, click Add to enter a new schema.

KeePass URL Overrides for Windows Terminal using SSH

As a scheme name I use “winterm” here. Under URL override, insert the following line.

cmd://wt ssh "{USERNAME}@{TITLE}"

  run “wt” to start the windows terminal emulator, then append the user name in brace and the hostname from the title field.

Confirm with OK and close KeePass and start again.

KeePass Add Entry for SSH in Windows Terminal

After our schema element winterm is created, we create a new entry with choose Add Entry, enter the hostname in Title, enter User name and Password, in the field URL insert “winterm:” append with colon.

SSH Windows KeePass Add Entry

Start Windows Terminal SSH session

KeePass double-click the URL item

The saved entry is now available, with a double click on URL the SSH connection is started here to the Linuxmint.

SSH from Windows Terminal on Windows 11 using KeePass

Windows Terminal connect SSH launch from KeePass

Public key authentication

SSH authentication using public key in Windows Terminal launch from KeePass is not only more secure, logging in without entering a password is also easier. For this purpose, a key pair is generated on the client, the public part of the key is transferred to the server, then the server is set up for asymmetric encryption and authentication, more on this in the tutorial here or find on ssh-keygen how it works.

Under the path of the Windows user profile, create a directory “.ssh”, with dot (.), the easiest way to change to the path is to enter “%USERPROFILE%” in the Windows Explorer address bar.

Windows Explorer Address Bar User Profiles

The directory for e.g. c:\users\james\.ssh, which contains the file with the private key “key-ecdsa“, as well as the file “config“.

.ssh folder under the user profile

  The known_hosts file is automatically generated by SSH as soon as a connection has been successfully authenticated for the first time. SSH add fingerprints to known_hosts to avoid Man-in-the-middle attacks.

We create the “config” file using the Notepad Editor, paste in the following lines.

Host linuxmint
     User james
     IdentityFile ~/.ssh/key-ecdsa
     ServerAliveInterval 60

The host name is that one we use in KeePass at Title, the user i.e. james, the key file refers with IdentityFile to the file “key-ecdsa” under %USERPROFILE%.ssh.

SSH Windows keepass, create the "config" file using the Notepad

  OpenSSH on Windows is a port from the OpenBSD-project (open source), on unixoid operating systems the tilde (~) character is used as a relative path to the user home directory, known on Windows as the environment variable %USERPROFILE%. A leading point in file names and directories (.ssh) applies to hidden files and directories on unixoid systems.

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

2 thoughts on “Windows Terminal SSH connection from KeePass”

  1. Hello,

    Very interesting article.

    If I try to follow the same steps (login with username and password), the terminal prompt me for password. And I am not sure how I can give it to the promnt in automatic way.
    On the video you were able to login without any issue.
    I am wondering in the first part of article (when you are login to linuxmind), did you login only with username and password, or you were using ssh key?

    1. it is most likely due to the ssh server setting and the public key, try run the connection in cmd with ssh -vvv user@host, the hostname must match the one in the ~/.ssh/config file, check also the public key on the remote host under ~/.ssh/authorized_keys

Leave a Reply

Your email address will not be published. Required fields are marked *