LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2004, 04:21 AM   #1
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 288

Rep: Reputation: 31
Multiple file copy


Ok I think I'm about to ask a really stupid question, but here goes!
If I have a DHCP, Web and DNS server IP 192.168.1.1 and say I want to copy a firewall script to all the other PC's on the network IP 192.168.1.1/24 how can it be done from the 1 PC(192.168.1.1)? Or is it not possible?

Thanx for any help!!!

Jimmy
 
Old 08-17-2004, 05:33 AM   #2
liinux
LQ Newbie
 
Registered: Aug 2004
Location: US
Posts: 27

Rep: Reputation: 16
u can ssh in to the pcs
 
Old 08-17-2004, 06:11 AM   #3
BlueKnight
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 32

Rep: Reputation: 15
Use scp to copy the file to the PCs.

Example:

Code:
scp firewall <user>@<ip_address>:<path>
Then you just put the correct values in there and off you go. If this seems to manual you can write a shell script:

Code:
#!/bin/ksh

# list of all PCs in the LAN
IPS="192.168.1.1 192.168.1.2 192.168.1.3"

for ip in $IPS ; do
     scp firewall <user>@$ip:<path>
done

exit 0
The "problem" here is that you have to supply the password manually. FTP is another possibility.
 
Old 08-17-2004, 06:39 AM   #4
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 288

Original Poster
Rep: Reputation: 31
FTP? Another newbie question, how would I be able to set that up so I can copy files from the 1 location to all the PC's? Is is difficult to do?
 
Old 08-17-2004, 07:09 AM   #5
BlueKnight
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 32

Rep: Reputation: 15
You need FTP servers on all the target machines and then in the same fashion as I showed you with scp you put the files to the FTP servers. However, the scp version should be ok IMO.

Please explain what you want to do in order to get the files to the machines. One command and fully automatic, which might require more work in order to get it working or is it okey to have some semi-automated thing like the scp-example, which in turn requires next to no work at all. More details please!
 
Old 08-17-2004, 07:10 AM   #6
BlueKnight
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 32

Rep: Reputation: 15
..or you can have one FTP server on the main machine and then FTP clients which get the files from it. Nothing is impossible you know
 
Old 08-17-2004, 07:35 AM   #7
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 288

Original Poster
Rep: Reputation: 31
I was thinking along the lines of 1 command and fully automated if its possible.
 
Old 08-17-2004, 07:56 AM   #8
BlueKnight
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 32

Rep: Reputation: 15
Take a look at this:

http://www.linuxgazette.com/node/view/193

This is more or less what I showed you, but scp can also be set up to not use passwords. This is done by copying the ssh public key of the user to all the remote machines and then you are automatically authenticated and logged in. Hope this helps you!
 
Old 08-17-2004, 08:01 AM   #9
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 288

Original Poster
Rep: Reputation: 31
That sounds like what I was after. Thanx 4 yr help, much appreciated
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I copy multiple files Leary664 Linux - General 18 09-06-2005 02:58 AM
scp/ssh tail(multiple file) remote copy tpreitano Linux - General 1 08-22-2005 02:17 PM
Copy one file to multiple directories cmfarley19 Linux - General 9 11-10-2004 12:57 PM
copy multiple files into one file HelpPlease Programming 2 12-09-2003 02:36 PM
copy 1 file to multiple dir script carpman Linux - General 14 02-07-2002 09:29 AM


All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration