quick ssh login using bash aliases and KeePass

I finally got tired of typing the password everytime I want to login to a remote ssh shell. I know, I could’ve set up key files for that, but my objective was to learn how to do it using KeePass.

The first step is to create the alias in .bashrc to login using predefined ssh arguments:

#setup gotodev alias in .bashrc
gotodev() {
(sleep 2 && keepass --auto-type)&
ssh amado@linuxb0x

The second step is to read the KeePass documentation for auto-type configuration settings.

For example, if we set the ‘title‘ property of the password entry to amado@linuxb0x that will match the title of the console window set by ssh when it asks for the password.

Final Results:

[amado@superflytnt ~]$ gotodev
amado@linuxb0x's password:
[amado@linuxb0x ~]$ _

The lesson learned here is, KeePass is awesome. Yeah!