Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/bin/bash
  2. HOST="aqui_pon_la_maquina_remota"
  3. USER="aqui_pon_el_usuario_remoto"
  4. PASS="aqui_pon_el_password_remoto"
  5. CMD=$@
  6. VAR=$(expect -c "
  7. spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMD
  8. match_max 100000
  9. expect "*?assword:*"
  10. send -- "$PASSr"
  11. send -- "r"
  12. expect eof
  13. ")
  14. echo "==============="
  15. echo "$VAR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement