Let's suppose you need to send a file to multiple hosts and you can not do it manually and you need to do it now. Below I talk you through three strategies you can use to send files in emergencies. SCP + EXPECT From the server send the file to each host using and to avoid entering the password many times SCP expect USER= PASS= DEST_PATH= list= i ; VAR=$(expect -c ) #!/bin/bash "user" "passwd" "/home/user" "192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6 " for in $list do " spawn scp -oStrictHostKeyChecking=no -oCheckHostIP=no file.txt @ : match_max 100000 expect \"*?assword:*\" send -- \" \r\" send -- \"\r\" expect eof " $USER $i $DEST_PATH $PASS echo " " $VAR #to see remote command answer done rsycn + EXPECT From each host download the file from the server using and to avoid entering the password many times rsync expect USER= PASS= DEST_PATH= list= i ; VAR=$(expect -c ) #!/bin/bash "user" "passwd" "/home/user" "192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6 " for in $list do " spawn rsync -e \"ssh -o StrictHostKeyChecking=no\" file.txt @ : match_max 100000 expect \"*?assword:*\" send -- \" \r\" send -- \"\r\" expect eof " $USER $i $DEST_PATH $PASS echo " " $VAR done Parallel-scp Use the command to sent the file from the server to each host (hosts list on the ips.txt file one per line) parallel-scp parallel-scp --askpass -lremote_host_user -h ips.txt file.txt /remote/host/dest/path "-O StrictHostKeyChecking=no" Bonus Tip If you lose ssh connection to a server but you still have session active this trick could help you. ;) Generate the file base64 file_to_copy > file_to_recover base64 directory_to_copy.tar.gz > file_to_recover tar cfz - $(rpm -ql ssh) | base64 > file_to_recover #For files #For directories #For RPMs Then copy the content of the file_to_recover in the host and recover it with these commands base64 -d file_to_recover base64 -d file_to_recover | tar xfz base64 -d < file_to_recover | tar xfz - #For files #For directories #For RPM