I need to setup passwordless SSH on a list of hosts using a shell script and a provided password for the user.
I’m not sure which way would be the best to do it. I though about using expect but I don’t like the way to “hack” into an interactive session. Is there any other way to do it?
The setup script needs to be very stable on Red Hat and SUSE.
There’s already a program that does this: ssh-copy-id. Of course you do need to give it the appropriate password; a well-worn tool for this is the program “expect.”