Files
exem-infra-shell/key.sh
2024-04-30 11:54:56 +09:00

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
}
}
}