SSH public key authentication: Difference between revisions

imported>Milahu
No edit summary
imported>Milahu
No edit summary
Line 8: Line 8:
Now the public key is stored on the <code>servermachine</code> in <code>/home/user/.ssh/authorized_keys</code>
Now the public key is stored on the <code>servermachine</code> in <code>/home/user/.ssh/authorized_keys</code>


Note: On the <code>clientmachine</code>, we created the public key file in the non-standard path <code>~/.ssh/servermachine</code>, so later we must use <code>ssh -i ~/.ssh/servermachine servermachine</code> to send our public key.
On the <code>clientmachine</code>, we stored the key file in the non-standard path <code>~/.ssh/servermachine</code>, so we must tell the SSH client to use the key file:
 
Now we must tell the SSH client to send the public key:


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
Line 18: Line 16:
The connection should work without password.
The connection should work without password.


To make the SSH client automatically use the public key file, we add this to <code>/home/user/.ssh/config</code>:
To make the SSH client automatically use the key file, we add this to <code>/home/user/.ssh/config</code>:


<syntaxhighlight>
<syntaxhighlight>