Guest User

Untitled

a guest
Apr 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. hoststeste=(161.148.21.31 161.148.21.32)
  2. password_saul=229052
  3.  
  4. set time_out 60
  5. /usr/bin/expect <<EOD
  6. spawn ssh $user@machine
  7. for hosteste in ${hoststeste[@]} {
  8. expect {
  9. "The authenticity of host" {send "yes\r"}
  10. "password:" {send "$password\r"}
  11. "*\]" { send "exit\r"}
  12. sudo useradd sgrimm
  13. "Digite a nova senha UNIX:" {send "$password_saul\r"}
  14. "Redigite a nova senha UNIX:" {send "$password_saul\r"}
  15. passwd -e sgrimm
  16. }
  17. }
  18. EOD
Add Comment
Please, Sign In to add comment