Browse Source

Allow credentials to be tabulated in all_hosts, change to environment password passing

master
Graham Northup 6 years ago
parent
commit
801649ec67
Signed by: grissess GPG Key ID: 5D000E6F539376FB
  1. 2
      README.md
  2. 8
      run.sh

2
README.md

@ -19,4 +19,4 @@ Note that `run.sh` invokes `ssh` via `sshpass`, and so respects your local confi
`all_addrs` usually contains IP addresses, but may also contain hostnames, or, really, anything acceptable past '@' in your version of ssh.
Please don't use password authentication with secure passwords on machines that others use. Anyone with access to `top` can see the password in the cmdline of `sshpass`!
As of this version, passwords are passed in the environment, so take care as to who can debug your programs; it should be more resistant to casual snooping, however.

8
run.sh

@ -2,6 +2,8 @@
command="$(cat batch.sh)"
for host in $(cat all_addrs); do
sshpass -p"$2" ssh "${1}@${host}" -p 13699 -o StrictHostKeyChecking=no -o PubkeyAuthentication=no "$command" 2>> /tmp/batch_errors &
done
while read host opt_user opt_pwd; do
user="${opt_user:-$1}"
password="${opt_pwd:-$2}"
SSHPASS="$password" sshpass -e ssh "${user}@${host}" -p 13699 -o StrictHostKeyChecking=no -o PubkeyAuthentication=no "$command" 2>> /tmp/batch_errors &
done < all_hosts
Loading…
Cancel
Save