Is it good to have multiple SSH keys?
It’s probably good to have many keys, e.g. one for GitHub, one for BitBucket, one for your server. By default ssh looks for the key called id_rsa.pub, we have to tell ssh to look for a different public key file depending on the service. This is where the config file comes handy.
How to generate a new SSH key pair?
The easiest, simplest way to solve this problem is to generate a new Ed25519 key pair because those always use the OpenSSH format, and you can do that with ssh-keygen -t ed25519. If you want to then copy it, the files are ~/.ssh/id_ed25519 and ~/.ssh/id_ed25519.pub.
How to generate public and private SSH keys?
Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location. d) Now you have new public key. APPEND this key to the downloaded authorized_keys file using cat command:
Where does my SSH key go when I log in?
Next it asks to make a passphrase, it’s a password you have to type when logging in with the key. It can be left blank by hitting enter. This is your key file that sits on the local machine. this is the public file that goes to your remote server.
Where does SSH look for the public key?
By default ssh looks for the key called id_rsa.pub, we have to tell ssh to look for a different public key file depending on the service. This is where the config file comes handy. The config file lives in ~/.ssh/config, if it’s not there, go ahead and make it: sudo touch ~/.ssh/config.
Why does SSH not ask for a password?
It’ll just use the first working key. Also you would only enter a passphrase if a given server is willing to accept the key. As seen above ssh didn’t try to ask for a password for .ssh/id_rsa even if it had one.
What does the-I flag mean on a SSH key?
Then try to ssh back into it by using the new key: The -i flag stands for identify, and should be a path to the file we just created. It’s probably good to have many keys, e.g. one for GitHub, one for BitBucket, one for your server.