Monday, 9 September 2019

Non-interactive one-time ssh && scp for 100 servers

I need to copy some data from a cluster of very restricted machines through the network which currently has DNS problems (so some connections are bizarrely not working). I found that the only way to copy the data from a machine is running scp from that machine. For now the workflow is:



  1. for each machine in machines

  2. ssh machine

  3. enter password

  4. scp files destination:results

  5. enter password

  6. wait

  7. repeat forever


I'm going mad over this manual labor. I want a solution which allows me to enter the password a single time. I've searched for solutions. Most recommend installing SSH keys, but this requires the same procedure to distribute the keys. Other mention the expect program, but I don't have it on that system.


How can this be accomplished?


Update: The main machine runs FreeBSD 9 and the 100 servers run Ubuntu 12. I don't have root on any machine.

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...