scripting question regarding in remote login to clients

Latest response

I currently am working on a intranet which has no internet access. I would like to have the the ability to remote login to each client and generate private keys to that I can run scripts for maintenance. I have found a script that does that. See below:

ssh key-gen && for host in $(cat hosts.txt); do ssh-copy-id $host;done.

However when this is run i would need to enter the repose to the generating of the keys, and the password to the client. Is this a simple way of doing that? I have 69 clients and this would get repetitive. I did try a number of ways to does this I.E passd but due to lack of internet i cannot down load this, I also tried to enter in the password via the read command and pass the variable but could not get that do work.

Any help would be appreciated as I am new to scripting. I am writing all scripts in the bash shell.

Regards,

Jon.

Responses