I am having a problem doing what I need. I can save a ton of time if I do this right.
I basically need to loop over every host, and I can get that part on my own.
But I can never get the command to come out right.
I basically want to do this for every host
chmod 750 /root; chown -R root:root /root;exit;
I've tried so many variants and all of them them will just ssh to the server and do nothing on that server. They never actually run that command on the destination server. Instead they end up running the command on the server I am running ssh from.
Also note public keys are already set up so passwords are no issue.
So to give a better understanding I will show this
for h in HOSTNAMES do
ssh $h; OTHER STUFF
done
chmod 750 /root && chown -R root:root /root?root? I think that has to be the number 1 problem. But we need to see some failed code to help fix it, we can't write it for you ;-) OK? Good luck.