Bureaucrats, cc_docs_admin, cc_staff
2,879
edits
No edit summary |
No edit summary |
||
Line 48: | Line 48: | ||
== Installing your key == <!--T:17--> | == Installing your key == <!--T:17--> | ||
=== Using CCDB === | |||
To install the key, you must make the target/destination system aware of the public part of your key. | To install the key, you must make the target/destination system aware of the public part of your key. | ||
On | On Compute Canada, we have recently (March 2021) added a convenient way to do this. You should visit: | ||
<!--T:18--> | <!--T:18--> | ||
Line 68: | Line 71: | ||
<!--T:22--> | <!--T:22--> | ||
Sometimes, you may encounter a key that is in an alternate format | Sometimes, you may encounter a key that is in an alternate format. | ||
For instance, this is a public key in PEM format: | |||
-----BEGIN RSA PUBLIC KEY----- | -----BEGIN RSA PUBLIC KEY----- | ||
MIIBCgKCAQEAxFm+Fbs+szeV2Vg2T5ufg8az0jD9DD/A0iNLKef2/0gPULn1ebFQ | MIIBCgKCAQEAxFm+Fbs+szeV2Vg2T5ufg8az0jD9DD/A0iNLKef2/0gPULn1ebFQ | ||
Line 80: | Line 83: | ||
<!--T:23--> | <!--T:23--> | ||
Public keys in RFC4716 or PKCS8 formats will look similar to PEM, with small variations in the header and footer lines. | |||
and | |||
=== Using the authorized_keys file === | |||
The CCDB method described above makes your public key available on all Compute Canada HPC systems. This is convenient, and is often desired. | |||
However, there may be circumstances in which you want to install a key only on a specific system. You can do this by adding the key | |||
to a file in your home directory on that system. For instance, to install a key that only works on Cedar, | |||
copy your public key into the file <code>~/.ssh/authorized_keys</code> on Cedar. | |||
This will allow you to log in to any of Cedar's login nodes using PK. | |||
On our systems (or any other with OpenSSH) the <code>ssh-copy-id</code> command is the most convenient way to do this: | |||
ssh-copy-id -i computecanada-key username@cedar.computecanada.ca | ssh-copy-id -i computecanada-key username@cedar.computecanada.ca | ||
<!--T:24--> | <!--T:24--> | ||
The authorized_keys mechanism is standard, and almost universally used on the internet. It is however somewhat fragile: | The <code>authorized_keys</code> mechanism is standard, and almost universally used on the internet. It is however somewhat fragile: | ||
Specifically, SSH is quite picky about the permissions on the <code>authorized_keys</code> file, as well as your home directory and the <code>.ssh</code> subdirectory. | |||
This is described further in [[Using_SSH_keys_in_Linux|using SSH keys in Linux]]. | |||
== Advanced Key Usage == <!--T:25--> | == Advanced Key Usage == <!--T:25--> |