Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Shelane French
Added: Jan 24, 2020 8:48 PM
Views: 95
Tags: ssh unix
  1. # The easiest method is to use ssh-copy-id
  2. ssh-copy-id username@remote_host
  3.  
  4. # ----------------- OR ---------------------
  5.  
  6. # Display public key and copy
  7. cat ~/.ssh/id_rsa.pub
  8.  
  9. # or use pbcopy
  10. pbcopy < ~/.ssh/id_rsa.pub
  11.  
  12. # On host machine, substitute public_key with copied key string
  13. echo public_key >> ~/.ssh/authorized_keys
Comments disabled