Copying files to different linux machines using scp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copying files to different linux machines using scp
# 1  
Old 04-12-2010
Copying files to different linux machines using scp

Hi alll

i had a file authorized_keys on machine one. now i need to copy this authorized keys file into machine2,machine 3.....

i use

scp authorized_keys root@192.168.168.11:/tmp/
for copying file .


is there ant way to copy the same filr to multiple machines at one go


what i mean is

scp auth_keys root@192.168.168.10
root@192.168.168.11
root@192.168.168.12

file should be copied all machines
# 2  
Old 04-12-2010
Easiest way:

Script like this:
for I in 192.168.168.10 192.168.168.11 192.168.168.12; do echo $I; scp $1 root@$I:$2 ; done

Two arguments are required:
- 1st what do you want to copy
- 2nd where do you want to copy it

You can hardcode arguments instead of using $1 and $2 is script.

Regards,
-Artur.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Logic - Copying the same files by 2 Linux scripts to same directory

Hi All, Good Morning ! Can anyone help me understand the following scenario. Scenario 1 : 2 LINUX Scripts(Process 1 & 2) are trying to copy the same file (lets call it FileA.txt) to the same directory (lets say, /home/abc/zyz) at the same time. If both copy is happening at the same... (9 Replies)
Discussion started by: dsfreddie
9 Replies

2. Shell Programming and Scripting

Nested loops for copying files on different machines

I want to run nested loop inside shell script using which I want to copy files on diff machines on round robin basis.Number of machiines is fixed as 4 but number of files may vary. For eg. Files: f1,f2,f3,f4,f5,f6 Machines: M1,M2,M3,M4 M1 - f1 M2 - f2 M3 - f3 M4 - f4 M1 - f5 M2 - f6 ... (1 Reply)
Discussion started by: baig_1988
1 Replies

3. Shell Programming and Scripting

Copying files from windows shared location to linux box

Hi, i am new to shell scripting. i have a requirement to copy the files from a windows shared location( vendor will place the files here) to Linux server( my Informatica will pick the files from this location). Files should be loaded in the order in which they were placed in windows box.(Based on... (1 Reply)
Discussion started by: Haari
1 Replies

4. Shell Programming and Scripting

shell script to copy files frm a linux machine to a windows machine using SCP

I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine. for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies

5. Shell Programming and Scripting

Error copying files from Unix (Solaris10) to Windows Server 2003 using scp/sftp

Hi, I have generated a Public/Private Key Pair in Solaris Unix (source) server and deployed the Public key in Windows 2003(target) server .ssh directory of user profile. When i try to connect(ssh, scp, sftp) from Unix, i'm getting below error message. Sun_SSH_1.1, SSH protocols 1.5/2.0,... (0 Replies)
Discussion started by: ajaykumarb
0 Replies

6. Shell Programming and Scripting

script for Copying files from one server to another using scp

Hi Scripting experts, I am new to the unix scripting. Please help me out for solving the condition given below I am trying to develop a script for Copying files which are getting generated in server A to server B using scp. In serverA files are generating as for eg abc1.txt, abc2.txt,... (5 Replies)
Discussion started by: rohithji
5 Replies

7. HP-UX

Windows and Linux OS for HP-UX machines

Hi All, I'm not sure if this has been posted before. Anyone knows a site how to do a hardware check (ex. ioscan) on an HP-UX machine that runs in Linux,Solaris and Windows? I'm checking the docs.hp.com and it gives me HP-UX stuff. does HP even supports such highlevel commands we use on HP-UX OS?... (2 Replies)
Discussion started by: grumash
2 Replies

8. Solaris

scp - copy between two remote machines?

1. scp person1@10.10.10.1:file1 person2@10.10.10.2:file1 2. scp file1 person1@10.10.10.1:file1 For #1, I keep getting this error: Password: Host key verification failed. lost connection I have entered the correct password too! #2 works fine. I suppose I cannot copy a file between two... (6 Replies)
Discussion started by: kungpow
6 Replies

9. Solaris

SCP from one solaris box to another without copying links

I am doing a scp (directory)from one solaris box to another.The problem is that all links present in that directory also get copied .I do not want the links to get copied .currently I am using following syntax scp -rvp pcserver info@appudemo.sea.us.wam.net:/home/info I checked the man... (1 Reply)
Discussion started by: u449064
1 Replies
Login or Register to Ask a Question