Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/bin/bash
  2. echo -n "Enter your university login: "
  3. read -e USER
  4.  
  5. for i in {0..71}; do expect -c 'spawn ssh username@mac1-'`printf "%03d" $i`' \"users\" ; expect -timeout 1 RSA { send "yes\n"; } ; expect Password { send "password\n" } ; interact' ; done
  6.  
  7. # replace username in usename@mac1 with your username
  8. # replace password in send "password\n" with your password
  9. # replace command in \"command\" with your command
  10.  
  11. # 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