SHARE
TWEET

Untitled

a guest Mar 26th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. ssh_copy_id() {
  4.  
  5. host=$1
  6. pass=$2
  7.  
  8. expect <<-EOF
  9.     spawn ssh-copy-id root@${host}
  10.     expect {
  11.         "*yes/no*" { send "yes\r"; exp_continue }
  12.         "*password*" { send "${pass}\r"; }
  13.     }
  14.     expect eof
  15. EOF
  16.  
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top