Both sides previous revisionPrevious revision | |
other:ssh [2024/11/28 17:57] – [Installing ssh keys] jypeter | other:ssh [2024/11/29 13:58] (current) – [Installing ssh keys] Improved jypeter |
---|
<note tip>**Special case**: | <note tip>**Special case**: |
| |
* ''spirit[x]'' servers: if you need to use the [[other:ssh#ipsl_servers|IPSL spirit[x] servers]], you had to send your //public// key when you requested your account, and the IT people will take care of putting your //public// key in the correct place when they create your account | * ''spirit[x]'' servers: if you need to use the [[other:ssh#ipsl_servers|IPSL spirit[x] servers]], you have to send your //public// key when you request your account, and the IT people will take care of putting your //public// key in the correct place when they create your account |
| |
</note> | </note> |
| |
The **required //ssh key// files have to be present in the ''.ssh'' [[other:ssh#configuration_files|directory where ssh stores its configuration files]]**, on the //source// **and** //target// computers. We assume that you have copied the required key files in the ''.ssh'' directory of both source and target computers. | The **required //ssh key// files have to be present in the ''.ssh'' [[other:ssh#configuration_files|directory where ssh stores its configuration files]]**, on the //source// **and** //target// computers. You do not need the same key files on the //source// **and** //target// computers, but it is easier to have all the key files in all the ''.ssh'' directories. This will also act as a backup of the key files in different locations. |
| |
| |
* on the **//source// computer**\\ (your local desktop/laptop, or a remote Linux server if you will use ssh/scp from this remote server to another remote server)\\ \\ | We assume below that you have copied the required key files in the ''.ssh'' directory of both //source// and //target// computers. We also assume that we are dealing with ''ed25519'' keys, so the //key// files will are named: ''id_ed25519'' (and ''id_ed25519**.ppk**'' on a Windows computer, if you use [[other:putty_conf#using_ssh_keys_with_putty_pageant|PuTTY/Pageant]]), and ''id_ed25519**.pub**''. |
* you need the //private// key: e.g. ''id_ed25519'' (and ''id_ed25519.ppk'' on a Windows computer, if you use [[other:putty_conf#using_ssh_keys_with_putty_pageant|PuTTY/Pageant]]) | |
| |
| * on the **//source// computer**\\ (your local desktop/laptop, or a remote Linux server if you will use ''ssh''/''scp'' from this remote server to another remote server)\\ \\ |
| * you need **the //private// key**: e.g. ''id_ed25519'' |
* remember that **the private key has to be readable only by the file owner (you!)** on a linux (or Mac) computer\\ <code>$ chmod 600 ~/.ssh/id_ed25519 | * remember that **the private key has to be readable only by the file owner (you!)** on a linux (or Mac) computer\\ <code>$ chmod 600 ~/.ssh/id_ed25519 |
| |
| |
* and the **//target// computer**\\ (a remote Linux server)\\ \\ | * and the **//target// computer**\\ (a remote Linux server)\\ \\ |
* you need the //public// key: e.g. ''id_ed25519.pub'' | * you need **the //public// key**: e.g. ''id_ed25519.pub'' |
* you need a copy of the //public// key in the ''authorized_keys'' file | * you need a copy of the //public// key in the ''authorized_keys'' file |
* **if the ''authorized_keys'' file does not exist yet**, just copy the //private// key file\\ <code>$ cd ~/.ssh | * **if the ''authorized_keys'' file does not exist yet**, just copy the //public// key file\\ <code>$ cd ~/.ssh |
| |
$ ls -l authorized_keys | $ ls -l authorized_keys |