linux_wiki:ssh_pub_priv_keys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:ssh_pub_priv_keys [2014/11/20 19:28]
127.0.0.1 external edit
linux_wiki:ssh_pub_priv_keys [2019/05/25 23:50] (current)
Line 1: Line 1:
 ====== SSH Pub/Priv Keys ====== ====== SSH Pub/Priv Keys ======
  
-Description: Create public/private key pair to login to remote systems with no password prompt.+**General Information**
  
-From the local client:+Create public/private key pair to login to remote systems with no password prompt.
  
-1) Create public/private key pair +**Checklist** 
-<code>+  * Distro(s): Any 
 + 
 +---- 
 + 
 +===== From the local client ===== 
 + 
 +==== Create public/private key pair ==== 
 +<code bash>
 ssh-keygen -t rsa ssh-keygen -t rsa
 Enter file to save the key (Enter for default). Enter file to save the key (Enter for default).
Line 17: Line 24:
   * $HOME/.ssh/id_rsa.pub = public key (this will go on server)   * $HOME/.ssh/id_rsa.pub = public key (this will go on server)
  
-2) Put public key on remote server(s) +==== Put public key on remote server(s) ==== 
-<code>+<code bash>
 ssh-copy-id -i $HOME/.ssh/id_rsa.pub username@server ssh-copy-id -i $HOME/.ssh/id_rsa.pub username@server
 </code> </code>
  
- a) If ssh-copy-id is not installed, use scp instead: +If ssh-copy-id is not installed, use scp instead 
-<code>+<code bash>
 scp $HOME/.ssh/id_rsa.pub username@server:~/tmp.pub scp $HOME/.ssh/id_rsa.pub username@server:~/tmp.pub
 ssh username@server ssh username@server
Line 30: Line 37:
 </code> </code>
  
-3) Ensure ssh-agent is running and add private key passphrase +==== Ensure ssh-agent is running and add private key passphrase ==== 
-<code>+<code bash>
 eval $(ssh-agent) eval $(ssh-agent)
 ssh-add ssh-add
 </code> </code>
- a)Enter private key passphrase to add private key to the ssh-agent.+Enter private key passphrase to add private key to the ssh-agent.
  
-4) Login to server, no password prompt because of ssh-agent/ssh-add +==== Login to server, no password prompt because of ssh-agent/ssh-add ==== 
-<code>+<code bash>
 ssh username@server ssh username@server
 </code> </code>
  • linux_wiki/ssh_pub_priv_keys.1416529701.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)