Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for i in {0..71}; do expect -c 'spawn ssh username@mac1-'`printf "%03d" $i`' \"echo \'users\'\" ; expect -timeout 1 RSA { send "yes\n"; } ; expect Password { send "password\n" } ; interact' ; done
- # replace username in usename@mac1 with your username
- # replace password in send "password\n" with your password
- # replace command in \"command\" with your command
- # note: sometimes expect will get confused when ssh asks to verify the host ingerprint. Once these have all been answered with 'yes', things work better.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement