Advertisement
R8934

Working with SSH keys

Aug 20th, 2017
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. On your computer, generate a key with the following command:
  2. - ssh-keygen -t rsa
  3. Walk through the steps, passphrase is optional.
  4.  
  5. Publish the key to remote:
  6. - cat ~/.ssh/id_rsa.pub | ssh user@123.45.67.89 "cat >> ~/.ssh/authorized_keys"
  7. When you get the output that the folder does not exist, use the following command:
  8. - cat ~/.ssh/id_rsa.pub | ssh user@123.45.67.89 "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
  9.  
  10. Verify that it all works with:
  11. - ssh user@123.45.67.89
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement