Everytime I have to login to a server I had to type the password. This ofcourse is not needed so I started making use of SSH keys. But, what if you want to use them with some other server to have access control? Like with your own Stash server, or Github or perhaps another something tool ;-)

This post is merely meant as a simple cheat sheet.

Create a new SSH key:

ssh-keygen -t rsa -b 4096 -C "email@domain.com"

Copy a existing SSH key to your clipboard (only working when locally)

pbcopy < ~/.ssh/id_rsa.pub

Display the SSH key in your console (so you can select and copy it)

cat ~/.ssh/id_rsa.pub

If you want to copy your SSH key to a remote server for convenience logging in

ssh-copy-id user_on_your_server@yourdomain.com

It will only ask for a password one time and after that you have simple logon!

Do you miss something here that should be in here absolutely? Don’t hesitate to put it in the comments!