I have some servers and I want to install SSL on all of them I wrote the following script(I should run it from each servers):
#!/bin/bash
#something to install SSL on centos
#....
#
note: I should run script like this(because of assigning ssl certs):
./ssl-conf <<EOF
> <CountryNmane>
> <StateName>
> <LocalityName>
> <OrganizationName>
> <OrganizationUnitName>
> <CommonName>
> <EmailAddress>
> <ChallengePassword>
> <CompanyName>
>EOF
now my question: I want to write a bash to do it with numbers of my servers.I wrote something like this(I should run it on my machine):
#!/bin/bash
while read pass port user ip; do
sshpass -p$pass -o 'StrictHostKeyChecking no' -p $port $user@$ip <<EOF <<SSH
US
something
newyork
test
test1
test2
test3
challengepassword
test4
EOF #End of asking questions
#commands to install SSL
#commands to install SSL
#commands to install SSL
SSH #end of commands running on remote machine
done <<___HERE
mypasswd 22 root 192.168.1.1
mypasswd 22 root 192.168.1.2
mypasswd 22 root 192.168.1.3
___HERE
Is this syntax right?
does not work.
any idea?
thank you in advance