LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-30-2012, 12:40 AM   #1
suboss87
Member
 
Registered: Dec 2010
Posts: 31

Rep: Reputation: 0
Red face How to push the script remotely to many servers by ssh or scp


Hi All,
I am having a script and I need to push that script remotely from my Linux machine to more than 50 servers. Please guide me how to push the script to all those servers remotely.

Note:

I need to write the script like this -- all ip-address of the server kept in an single file, So that the script should read the file and push it to each sever.

Kindly guid me the possible ways to do this..

Last edited by suboss87; 07-30-2012 at 01:42 AM.
 
Old 07-30-2012, 02:22 AM   #2
yahoosam
Member
 
Registered: Jun 2012
Posts: 79

Rep: Reputation: Disabled
i think u should think of curl libraries..
check out on googling
http://curl.haxx.se/libcurl/c/libcurl-tutorial.html

Last edited by yahoosam; 07-30-2012 at 05:32 AM.
 
1 members found this post helpful.
Old 07-31-2012, 12:25 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

UNTESTED, but basically like this
Code:
for ip in `cat ip_file`
do
    scp file user@${ip}:/dir
done
You'll need to have setup ssh-auth-keys to automate login process
http://www.linuxtopia.org/online_boo...erate-keypairs
 
  


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
Multiple scp/ssh in one bash script Lovelyhard Programming 13 07-31-2012 10:37 AM
Bash script using scp and ssh Drigo Linux - Newbie 6 08-05-2011 06:04 AM
Running multiple commands remotely via SSH in a script gimpy530 Linux - General 4 12-19-2009 11:22 PM
Shell Script with ssh & scp ErikJohnson Linux - Software 3 03-11-2004 05:53 PM
Shell Script with ssh & scp ErikJohnson Linux - Networking 1 03-11-2004 05:14 PM


All times are GMT -5. The time now is 04:32 PM.

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