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.

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

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.

Start Windows Terminal SSH session

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

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.

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“.

  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
     HostName 10.10.10.10
     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.

  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.

AnyDesk Address Book with KeePass

In this tutorial, KeePass Password Safe is used as the AnyDesk address book so that remote maintenance sessions can be started from KeePass.

The following steps show how to create a URL override scheme to get an AnyDesk session address.

Add KeePass URL Overrides

In the first step, go to the Integration section via ToolsOptions – and click the URL Overrides button, then add a new entry with Add.

cmd://cmd /C echo {PASSWORD} | "%ProgramFiles(x86)%\AnyDesk\AnyDesk.exe" {USERNAME} --with-password

After adding the url override scheme for AnyDesk, the new URL can be use in KeePass. But first KeePass must be closed and restarted.

The URL AnyDesk:

Into the field URL insert AnyDesk: the AnyDesk ID or alias is entered as the User name, and for Password the AnyDesk password.

Let’s start AnyDesk session

By double-clicking on “AnyDesk” in the URL column, the session is started. User name and password are passed to AnyDesk.

The KeePass Password Manager

KeePass Password Safe is a free password manager program available under the terms of the GNU General Public License (GPL). KeePass encrypts the entire database, which can also contain usernames and the like.

AnyDesk remote desktop application

AnyDesk is a remote desktop application distributed by AnyDesk Software GmbH. The proprietary software program provides platform independent remote access to personal computers and other devices running the host application. It offers remote control, file transfer, and VPN functionality. AnyDesk is often used by technical support to provide remote assistance.

Conclusion

This tutorial shows how to use the KeePass Password Safe as an AnyDesk address book so that remote maintenance sessions can be started from KeePass.

Exit mobile version