Save SSH credentials by creating secure shell key [Linux]

To login to a VPN/Server , we need to pass the login credentials. In SSH client like putty, we can save the username and password for quick login.

I was missing the same feature in Ubuntu. Especially, you cant even copy paste the password.A pain if you use password managers (which you should) like keepass which will generate really strong passwords.

There is one way to overcome this problem, use the private key feature to bypass credential request(Secure Shell Key). To do this , just open passwords and keys
Passwords and keys
Passwords and keys


Select new. Then select secure shell key.
New Secure Shell Key
New Secure Shell Key
Give the description.
Description of the key
Description of the key
One can assign a simple password(optional) or no password for this key.
Passphrase(optional password for the key)
Passphrase(optional password for the key)

You can leave it blank if you want to login to SSH without any authentication corresponding to this pass-phrase.

Next is give the computer name (Normally IP address of the server ) and Username (root or any user for which you have authorization ).
Server Details
Server Details

It may ask you for the password credentials of the sever (If you have logged in earlier , it will not ask for any password credentials since the public key will be saved when you logged in successfully earlier).
Server credentials
Server credentials

Thats it :)

Now try to login to the server by issuing simple ssh command
ssh <server> -l <user>
It will login directly without asking for credentials :).

UPDATE: One can make passphrase auto remember while you login with ssh-agent. This is recommended as other  users may use the same secure shell key to access the server. To prevent this, just use a passphrase and when it is prompting for passphrase, drop down details and select "Automatically unlock this keyring whenever i'm logged in"

 passphrase auto remember
 passphrase auto remember
Thanks Mitesh Shah for mentioning it  :)

About This Blog

There is something for everyone. !! A tech blog on various topics. Let it be devops, programming etc; we have it all covered here in layman terms :)

Total Pageviews

Back to TOP