generate and login with SSH-Keys


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # goto ssh dir
  2. ~/.ssh
  3.  
  4.  
  5. # if not existing, first create folder
  6. mkdir ~/.ssh && chmod 700 ~./.ssh
  7.  
  8.  
  9. # Generate Keypair - Enter and password
  10. ssh-keygen -t dsa
  11.  
  12.  
  13. # export key to your server
  14. cat id_dsa.pub | ssh root@yourserver.com 'cat >>~/.ssh/authorized_keys'
  15.  
  16. # now you can login
  17. ssh root@yourserver.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.