Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux_wiki:configure_key-based_authentication [2016/09/06 21:44] billdozor created |
linux_wiki:configure_key-based_authentication [2016/10/08 18:04] billdozor |
||
---|---|---|---|
Line 4: | Line 4: | ||
SSH key based authentication (password-less). | SSH key based authentication (password-less). | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Lab Setup ====== | ||
+ | |||
+ | The following virtual machines will be used: | ||
+ | * server1.example.com (192.168.1.150) -> The SSH client | ||
+ | * server2.example.com (192.168.1.151) -> The SSH server | ||
---- | ---- | ||
Line 23: | Line 31: | ||
Copy the public key to a remote system | Copy the public key to a remote system | ||
<code bash> | <code bash> | ||
- | ssh-copy-id | + | ssh-copy-id myserver |
</ | </ | ||
* Prompted for password login | * Prompted for password login | ||
* Next normal ssh login will be password-less | * Next normal ssh login will be password-less | ||
+ | |||
+ | \\ | ||
+ | __**Key Pair with Passphrase**__ | ||
+ | |||
+ | If you created the key pair with a passphrase, it is useful to cache the passphrase for a bash session to avoid re-entering it for each ssh connect. | ||
+ | |||
+ | \\ | ||
+ | Start the ssh-agent for the current shell | ||
+ | <code bash> | ||
+ | ssh-agent bash | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Add the passphrase | ||
+ | <code bash> | ||
+ | ssh-add | ||
+ | </ | ||
+ | * Prompted for the ssh key passphrase | ||
+ | |||
+ | \\ | ||
+ | Connect as normal with ssh, you should not be prompted for a password if the public key has already been copied to the remote server. | ||
---- | ---- | ||