I had setup my clients & server for passwordless login. Like passwordless login by copying RSA key of server to all client's /root/.ssh/id-rsa.pub. but this, I have done manually. I like to automate this process using shell script and providing password to the machines through script. If this problem is solved then I also want to use rsync to automate push items to all servers. Can any body help me in this regard.
Thank you
If you need to push updates/changes to multiple computers in a network then you may want to consider looking at something like Puppet that works outside the normal channels.
you could use expect to log into a remote machine when the
.ssh/authorized_keys
method is not avaliable. For example:This script comes in Debian (and derivatives) machines, to distribute the keys. It's called ssh-copy-id. You'd use it like this:
Then you'd enter the password and the copying would be done. You would do this one time only and then could use the rsync over ssh as usual.