Don't like ads? PRO users don't see any ads ;-)
Guest

Linux Passwordless SSH

By: fduran on Apr 21st, 2011  |  syntax: Bash  |  size: 0.41 KB  |  hits: 752  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # ssh without passwords, useful for unattended automatic scp/rsync-over-ssh copies etc
  2. # www.fduran.com
  3.  
  4. # Create public key without password in origin server:
  5. ssh-keygen -t dsa
  6.  
  7. # if ssh target port is not 22, add it (ex: -p 2020) in ssh-copy-id after 'ssh':
  8. # nano /usr/bin/ssh-copy-id
  9.  
  10. # Upload public key to remote target server:
  11. ssh-copy-id -i /root/.ssh/id_dsa.pub remote_ip
  12.  
  13. # test:
  14. ssh -p 2020 remote_ip