Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hoststeste=(161.148.21.31 161.148.21.32)
- password_saul=229052
- set time_out 60
- /usr/bin/expect <<EOD
- spawn ssh $user@machine
- for hosteste in ${hoststeste[@]} {
- expect {
- "The authenticity of host" {send "yes\r"}
- "password:" {send "$password\r"}
- "*\]" { send "exit\r"}
- sudo useradd sgrimm
- "Digite a nova senha UNIX:" {send "$password_saul\r"}
- "Redigite a nova senha UNIX:" {send "$password_saul\r"}
- passwd -e sgrimm
- }
- }
- EOD
Add Comment
Please, Sign In to add comment