Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

Configure SSH Key-Based Authentication

114 bytes removed, 22:26, 29 October 2017
Copying your Public Key Using SSH-Copy-ID
The syntax is:
<pre class="code-pre "><code>ssh-copy-id <span class="highlight">username</span>@<span class="highlight">remote_host</span></code></pre>
You may see a message like this:
<pre class="code-pre "><code>The authenticity of host '111.111.11.111 (111.111.11.111)' can't be established.
ECDSA key fingerprint is fd:fd:d4:f9:77:fe:73:84:e1:55:00:ad:d6:6d:22:fe.
Are you sure you want to continue connecting (yes/no)? yes
</code></pre>
This just means that your local computer does not recognize the remote host. This will happen the first time you connect to a new host. Type "yes" and press ENTER to continue.
Next, the utility will scan your local account for the <code>id_rsa.pub</code> key that we created earlier. When it finds the key, it will prompt you for the password of the remote user's account:
<pre class="code-pre "><code>/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
username@111.111.11.111's password:
</code></pre>
Type in the password (your typing will not be displayed for security purposes) and press ENTER. The utility will connect to the account on the remote host using the password you provided. It will then copy the contents of your <code>~/.ssh/id_rsa.pub</code> key into a file in the remote account's home <code>~/.ssh</code> directory called <code>authorized_keys</code>.
You will see output that looks like this:
<pre class="code-pre "><code>Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'username@111.111.11.111'"
and check to make sure that only the key(s) you wanted were added.
</code></pre>
At this point, your <code>id_rsa.pub</code> key has been uploaded to the remote account. You can continue onto the next section.