Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement