SSH key has two parts:
- the private key that should be secured by strong password
- the public key (usually ending with .pub suffix) that should be copied to the server
You can move both parts freely as you wish, although I wouldn't recommend you to place the private part publicly (even encrypted).
The private part is placed on any of your local machines in ~/.ssh/ directory. The expected key names are
- id_rsa
- id_rsa-cert
- id_dsa
- id_dsa-cert
- id_ecdsa
- id_ecdsa-cert
- id_ed25519
- id_ed25519-cert
If your key has one of the respective names you are good to go. If you need to use some specific key you have to use parameter -i
/usr/bin/ssh -i <path_to_key_file>
The same is for the public - server - part. In the users home directory must exist a file ~/.ssh/authorized_keys. This file contains all publc keys, that are allowed to login as the user - one per line. The comment part can be omitted.
That said on any server you would like to use any of your SSH keys, copy the public part on a new line in authorized_keys file.
I'd advise you to study the manual page of SSHD (man sshd), especially part "AUTHORIZED_KEYS FILE FORMAT".
Also i think that I also should warn you that there are some rules for filesystem permissions for the home directory, ~/.ssh directory and the ~/.ssh/authorized_keys file as stated in the sshd manual page, in short it canot be writable by others.
~/.ssh/authorized_keys
Lists the public keys (DSA/ECDSA/RSA) that can be used for logging in as this user. The format of this file is described
above. The content of the file is not highly sensitive, but the recommended permissions are read/write for the user, and
not accessible by others.
If this file, the ~/.ssh directory, or the user's home directory are writable by other users, then the file could be modi‐
fied or replaced by unauthorized users. In this case, sshd will not allow it to be used unless the StrictModes option has
been set to “no”.