Differences
This shows you the differences between two versions of the page.
linux_wiki:ssh_pub_priv_keys [2014/11/13 23:15] billdozor created |
linux_wiki:ssh_pub_priv_keys [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== SSH Pub/Priv Keys ====== | ||
- | Description: | ||
- | |||
- | From the local client: | ||
- | |||
- | 1) Create public/ | ||
- | < | ||
- | ssh-keygen -t rsa | ||
- | Enter file to save the key (Enter for default). | ||
- | Enter password twice to encrypt key pair. | ||
- | </ | ||
- | |||
- | Two files are created: | ||
- | |||
- | * $HOME/ | ||
- | * $HOME/ | ||
- | |||
- | 2) Put public key on remote server(s) | ||
- | < | ||
- | ssh-copy-id -i $HOME/ | ||
- | </ | ||
- | |||
- | a) If ssh-copy-id is not installed, use scp instead: | ||
- | < | ||
- | scp $HOME/ | ||
- | ssh username@server | ||
- | cat $HOME/ | ||
- | rm tmp.pub | ||
- | </ | ||
- | |||
- | 3) Ensure ssh-agent is running and add private key passphrase | ||
- | < | ||
- | eval $(ssh-agent) | ||
- | ssh-add | ||
- | </ | ||
- | | ||
- | |||
- | 4) Login to server, no password prompt because of ssh-agent/ | ||
- | < | ||
- | ssh username@server | ||
- | </ |