

Then, we switch to the SSH Agent category : The fields Password & Repeat are to be filled with the passphrase. ( A restart of KeePassXC is required) Add the key to KeePassXCĪfter creating a database, we can then add a new entry for the ssh-key : In KeePassXC Settings, the checkbox Enable SSH Agent from the SSH Agent category must be selected. Enable ssh-agent integration within KeePassXC To be able to login as valouille to my server, I add the content of the public key /Users/valouille/.ssh/id_rsa.pub inside the /home/valouille/.ssh/authorized_keys file.įor now, if I try to connect to my server, I’ll be prompted to write down my passphrase to unlock the key. In this case, I create a 4096 bits RSA key. SHA256:PGfu6mBVTSTXxMAHx0odNltC8Z0LU61N/xwa+GPgM/M key's randomart image is: Your public key has been saved in /Users/valouille/.ssh/id_rsa.pub. Your identification has been saved in /Users/valouille/.ssh/id_rsa. Users/valouille/.ssh/id_rsa already exists.Įnter passphrase (empty for no passphrase): $ ssh-keygen -b 4096Įnter file in which to save the key (/Users/valouille/.ssh/id_rsa): If you don’t already own a pair of keys, you can use ssh-keygen to get new ones. And display a confirmation dialog whenever the key is acceded ! Generate a key pair It can also unload keys from ssh-agent when the lid is closed, the screen is locked, or in case of prolonged inactivity. KeePassXC is well maintained, and we can take advantage of the new features built inside ! KeePassXC can now store ssh-keys and associated passphrase, and add them into ssh-agent, allowing SSH connection using public key authentication.

KeePassXC is a password manager, forked from KeepassX, itself a Linux port of KeePass. But this can be a security caveat, since any malware or anybody who can access the laptop can then use the ssh-key to connect to servers.Ī good way to prevent this from happening is to use KeePassXC to manage your ssh-keys. Since it can be painful to type it every time one wants to login to a server, ssh-agent is often used to bypass this. A good practice is to protect the keys with a long-enough passphrase. SSH-keys are the most common way to connect to a server securely and in an effortless way.
