KeePass integration with SSH (SSH-Key), RDP, SFTP clients

KeePass Password Safe – cross-platform free password storage software released under the GPL license

KeePass integration uses URL Overrides settings

Connecting from KeePass via RDP without entering IP, login, password

Since the default RDP client (mstsc) does not support the transfer of login / password from the command line, we will use a layer in the form of a utility Remote Desktop Plus… Download and install it.

Moving on to setting up KeePass

Сервис – Параметры - Интеграция – Переопределение URL 

Add a new schema:

- Схема: rdp
- Переопределение: cmd://rdp /v:{URL:RMVSCM} /u:{USERNAME} /p:{PASSWORD}

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 4

Apply the changes, go to KeePass and add a new entry or modify a previously added one.

In the “URL-link” field, write an entry in the form:

rdp://%ip%:%port%

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 5

Now, if you select this entry and press the key combination Ctrl + U, an RDP session will open, ip / login / password will be pulled from KeePass.

Connecting from KeePass via SSH without entering IP, login, password

Downloading Putty and install it so that the necessary variables are registered in the system.

If you are using Kitty (Fork Putty), rename putty.exe to _putty.exe in the C: Program Files PuTTY directory, download Kitty, we rename kitty.exe into putty.exe and move it to “C: Program Files PuTTY”

Moving on to setting up KeePass

Сервис – Параметры - Интеграция – Переопределение URL 

In the “Built-in Overrides” block, disable the “ssh” scheme and add a new one:

- Схема: ssh
- Переопределение: cmd://"putty.exe" -ssh {USERNAME}@{URL:RMVSCM} -P {T-REPLACE-RX:/{URL:PORT}/^-1$/22/} -pw "{PASSWORD}"

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 6

Apply the changes, go to KeePass and add a new entry or modify a previously added one.

In the “URL-link” field, write an entry in the form:

ssh://%ip%:%port%

Moreover, if the ssh port is standard (22 / tcp), then it can be omitted.

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 7

Now if you select this entry and press the key combination Ctrl + U, an SSH session will open in Putty or Kitty, ip / login / password will be pulled from KeePass.

Connect from KeePass over SSH using an SSH key (certificate) stored in KeePass

Download the plugin for KeePass – KeeAgent

Unpack it to “C: Program Files (x86) KeePass Password Safe 2 Plugins” and restart KeePass.

Moving on to setting up KeePass

Сервис – Параметры - KeeAgent

In addition to the items marked by default, note:

  • Always require user confirmation when a client program requests to use a key
  • Enable agent for Windows OpenSSH (experimental)

We mark the integrations (first create the C: Temp directory):

  • Create Cygwin compatible socket filePath: C: Temp cyglockfile
  • Create msysGit compatible socket filePath: C: Temp syslockfile

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 8

Apply the changes, go to KeePass and add a new entry or modify a previously added one.

Go to the “Advanced” tab, and in the “Attached files” section, add the private ssh-key, which was generated by the PuttyGen utility. (If you do not have ssh-key authorization configured, there are many articles on the Internet on how to configure it)

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 9

Go to the KeeAgent tab and mark:

  • Allow KeeAgent to use this entry

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 10

Apply the changes, go to KeePass, select the added entry and press Ctrl + U

A new SSH session will open in Putty or Kitty, the ssh key will be pulled from KeePass.

You will also be prompted to use the SSH Key, and after connecting – a notification from KeeAgent.

And now you can connect via SSH using an SSH key from third-party SSH clients (Windows OpenSSH, Putty, Kitty, mRemoteNG) and the SSH key will be pulled from KeePass.

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 13

If KeePass is locked, the KeePass password entry window will appear

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 14

Unfortunately, SSH clients xShell and SecureCRT are not supported for using the keepass + ssh key scheme, since they use their agents to store ssh keys.

Connecting from KeePass over SFTP using WinSCP

Download and install WinSCP

Moving on to setting up KeePass

Сервис – Параметры - Интеграция – Переопределение URL

Add a new schema:

- Схема: scp
- Переопределение: cmd://"{ENV_PROGRAMFILES_X86}WinSCPWinSCP.exe" {BASE:SCM}://{USERNAME}:{PASSWORD}@{BASE:HOST}:{T-REPLACE-RX:/{BASE:PORT}/-1//}{BASE:PATH}

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 15

Apply the changes, go to KeePass and add a new entry or modify a previously added one.

In the “URL-link” field, write an entry in the form:

scp://%ip%:%port%

KeePass integration with SSH (SSH-Key), RDP, SFTP clients 16

Now, if you select this entry and press the key combination Ctrl + U, an SFTP session will open in the WinSCP SFTP client, ip / login / password will be pulled from KeePass. And if SSH key authorization is configured, then the SSH key will be pulled from KeePass.

In the same way, you can configure the integration of KeePass with other protocols / clients: FTP, VNC, etc.

Sidebar