Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

Configure SSH Key-Based Authentication

170 bytes removed, 22:25, 29 October 2017
How To Create SSH Keys
<pre class="code-pre ">$bash>ssh-keygen
Generating public/private rsa key pair. <br>Enter file in which to save the key (/home/username/.ssh/id_rsa):
</pre>
 
The utility will prompt you to select a location for the keys that will be generated. By default, the keys will be stored in the <code>~/.ssh</code> directory within your user's home directory. The private key will be called <code>id_rsa</code> and the associated public key will be called <code>id_rsa.pub</code>.
If you had previously generated an SSH key pair, you may see a prompt that looks like this:
<pre class="code-pre ">/home/<span class="highlight">username</span>/.ssh/id_rsa already exists.
Overwrite (y/n)?
</pre>
 
If you choose to overwrite the key on disk, you will '''not''' be able to authenticate using the previous key anymore. Be very careful when selecting yes, as this is a destructive process that cannot be reversed.
<pre class="code-pre ">Created directory '/home/<span class="highlight">username</span>/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
A passphrase is an optional addition. If you enter one, you will have to provide it every time you use this key (unless you are running SSH agent software that stores the decrypted key). We recommend using a passphrase, but if you do not want to set a passphrase, you can simply press ENTER to bypass this prompt.
<pre class="code-pre "><code>Your identification has been saved in /home/<span class="highlight">username</span>/.ssh/id_rsa.Your public key has been saved in /home/<span class="highlight">username</span>/.ssh/id_rsa.pub.
The key fingerprint is:
a9:49:2e:2a:5e:33:3e:a9:de:4e:77:11:58:b6:90:26 <span class="highlight">username</span>@remote_host
The key's randomart image is:
+--[ RSA 2048]----+
|o=++. |
+-----------------+
</code></pre>
You now have a public and private key that you can use to authenticate. The next step is to place the public key on your server so that you can use SSH key authentication to log in.