Advertisement
mindthump

Setting up password-less SSH

Sep 15th, 2020 (edited)
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. ssh-keygen -t rsa
  2. ssh morty@192.168.0.1 mkdir -p .ssh
  3. cat .ssh/id_rsa.pub | ssh morty@192.168.0.11 'cat >> .ssh/authorized_keys'
  4. ssh morty@192.168.0.11 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
  5. ssh morty@192.168.0.11
  6.  
  7.  
  8. keygen one-liner:
  9. ssh-keygen -t dsa -N "my passphrase" -C "test key" -f mykey
  10. OR
  11. HOSTNAME=`hostname` ssh-keygen -t rsa -C "$HOSTNAME" -f "$HOME/.ssh/id_rsa" -P "" && cat ~/.ssh/id_rsa.pub
  12. OR
  13. ssh-keygen -f id_rsa -t rsa -N ''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement