SSH Keys: Difference between revisions
No edit summary |
|||
Line 203: | Line 203: | ||
[https://keepassxc.org/ KeyPassXC] is a cross-platform password manager that can securely store your SSH keys. | [https://keepassxc.org/ KeyPassXC] is a cross-platform password manager that can securely store your SSH keys. | ||
When configuring your .ssh/config file you may want to pass the IdentityFile directive to a host to ensure that the ssh agent only uses a specific key to connect to a host. This directive requires you to provide the path to your key file. When we add an ssh key to the KeePassXC agent we are deleting the file from our filesystem in order to protect it which conflicts with this. The solution is to pass the .pub public key file for your host to the IdentityFile instead of the private key. you can generate a key as described in the above sections. Add that key to your keepassxc agent to protect it and then keep the public key in your .ssh/ directory. This will allow you to set your .ssh/config to use a key that is only available in the agent. | |||
<pre> | |||
Host git.example.com | |||
Hostname git.example.com | |||
Port 22 | |||
User git | |||
PreferredAuthentications publickey | |||
IdentityFile ~/.ssh/mygitkey.pub | |||
</pre> | |||
<span id="references"></span> | <span id="references"></span> |