Decomment hosts

This commit is contained in:
Alexandre Iooss 2020-05-03 18:40:26 +02:00
parent 3b72e2fe2d
commit dc2db3d6a3
No known key found for this signature in database
GPG key ID: 6C79278F3FCDCC02
4 changed files with 29 additions and 319 deletions

View file

@ -6,10 +6,15 @@ HOSTS=$(grep -ve '^[#\[]' hosts \
| grep -F adm.auro.re \
| sort -u)
# Ask password
read -s -p "Hello adventurer, what is your LDAP password? " passwd
echo
for host in $HOSTS; do
echo "Handling host $host"
echo "[+] Handling host $host"
# sshpass can be used for non-interactive password authentication.
# place your password in ldap-password.txt.
sshpass -f ldap-password.txt ssh-copy-id "$host"
SSHPASS=${passwd} sshpass -v -e ssh-copy-id -i ~/.ssh/id_rsa "$host"
done