#!/usr/bin/expect -f # # Filename: copy-keys-v.4.exp # Called by: dist_ora_keys.sh # Written by: WG 2009-02-04 # Updated 2009-08-01 # http://www.virtfoundry.com # wgoodric@virtfoundry.com # # Copy oracle ssh public key to cluster members' oracle accounts # set user [lindex $argv 0] set host [lindex $argv 1] set pass [lindex $argv 2] spawn ssh-copy-id -i /home/$user/.ssh/id_rsa.pub $user@$host expect "authenticity" { send "yes\r" } expect "password:" { send $pass\n } expect "eof"