This commit is contained in:
ByeonJungHun
2023-07-13 16:17:15 +09:00
parent c695de6940
commit 5812e10973
4 changed files with 22 additions and 3 deletions

19
key.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/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
}
}
}