This question is repeating from Stack Overflow because i don't get answer from there.
I'm trying to make a simple script that will import the public key to other servers.
I have made 2 options you can choose. One is using ssh-copy-id, and the other is simple copy the pub key to the file on the other server. The second one works ok but I cant make this to work wiht ssh-copy-id. This is what I have for now:
ssh-copy-id -i $var1 $i
Where $var1 is "/path/to/the/public_key.pub" and $i is the servers where they are written in a txt file. The whole idea is I have my pub keys everywhere and I like to enter the pub key of a new admin guy everywhere. And it works ok but when I execute I have to enter my password. Any solution to do this with one time entering the password. And also I like to enter new line before adding the key. But I can't find solution how to do this with ssh-copy-id