Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- HOST="aqui_pon_la_maquina_remota"
- USER="aqui_pon_el_usuario_remoto"
- PASS="aqui_pon_el_password_remoto"
- CMD=$@
- VAR=$(expect -c "
- spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMD
- match_max 100000
- expect "*?assword:*"
- send -- "$PASSr"
- send -- "r"
- expect eof
- ")
- echo "==============="
- echo "$VAR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement