20 lines
357 B
Bash
Executable File
20 lines
357 B
Bash
Executable File
#!/usr/bin/expect -f
|
|
|
|
set user "root"
|
|
set password "saasadmin1234"
|
|
|
|
for {set i 200} {$i <= 219} {incr i} {
|
|
set host "10.10.43.$i"
|
|
spawn sh -c "ssh-copy-id -o StrictHostKeyChecking=no $user@$host"
|
|
expect {
|
|
"*password:" {
|
|
send "$password\r"
|
|
exp_continue
|
|
}
|
|
eof {
|
|
break
|
|
}
|
|
}
|
|
}
|
|
|