Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

First of all I am not a trained professional in Networking nor I know much about it. I have some knowledge of GNU/Linux, Shell scripting. One day I wanted to copy a large zipped file to a set of computers in my lab and have to do some other tasks there. I use DHCP for my systems.

Looking for the best way to do that.

Sorry if this question not belongs here or is utter nonsense.

share|improve this question
    
All of them running Linux? Did you setup ssh public key authentication? –  quanta Aug 30 '11 at 6:43
    
@quanta All systems runs Debian. I didnt have ssh server. Only client installed. Looking for an easy solution. Security is not a problem since all the systems are in local network only and data is not that important –  user71866 Aug 30 '11 at 6:46
add comment

6 Answers 6

There are multiple ways of accomplishing a file copy/transfer between systems ranging from:

  • scp
  • smb
  • ftp (or any of its more secure variants)
  • nfs
  • http
  • etc., etc....

It comes down to what is installed on the systems and your level of comfort with the various options. There are "multicasting" options, if the one-to-multiple copy situations come up frequently enough to consider those technologies/solutions.

share|improve this answer
add comment

Func is an excellent tool to copy a file to multiple machines and also executing commands on multiple machines, developed by RedHat and the community. Excellent to manage clusters of servers etc. However I'm not sure it works flawlessly with DHCP, you need signed certificated to communicate with clients, but it's wrth testing if it suits your needs

share|improve this answer
add comment

http + wget FTW.

Set up a web server on one central host then use wget to download the file.

share|improve this answer
add comment

Fabric seems to be your solution :

http://docs.fabfile.org/en/1.2.1/index.html

share|improve this answer
add comment

The standard method on Unix used to be rdist and it is still available in most repositories today. However today's problem is that we use SSH not RSH and so the management of keys and passwords may be more inconvenient.

share|improve this answer
add comment
  1. Create a list of your target servers, e.g list.txt:

    ip1 port1 username1 password1
    ip2 port2 username2 password2
    ...
    
  2. Install sshpass on the client.
  3. Create a shell script scp.sh as belows:

    #!/bin/bash
    
    while read line; do
        ip=`echo $line | awk '{ print $1 }'`
        port=`echo $line | awk '{ print $2 }'`
        user=`echo $line | awk '{ print $3 }'`
        password=`echo $line | awk '{print $4 }'`
    
        echo $password | sshpass scp -P $port /your/zipped/file $user@$ip:/path/to/somewhere/
    done < list.txt
    
  4. Make it executable and run with:

    chmod +x scp.sh
    ./scp.sh
    

If you need to do the same tasks later, I would suggest installing ssh public key authentication and do parallel with pssh, something like this:

cat list.txt
ip1:port1 username1
ip2:port2 username2
...

pscp -h list.txt /your/zipped/file /path/to/somewhere
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.