LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 03-07-2008, 06:50 AM   #1
irfanb146
LQ Newbie
 
Registered: Mar 2008
Posts: 19

Rep: Reputation: 0
Writing a shell script for copying file from one server to other by using third serve


echo "COPY FROM WHICH SERVER"
read s1
echo "COPY FROM WHICH USER"
read u1
echo "COPY TO WHICH LOCATION"
read s2
echo "COPY TO WHICH USER"
read u2
echo "WHERE IS THE FILE AND WHICH FILE"
read f1
scp $u1@$s1:$f1 $u2@$s2:/home/oracle

Following is the error

Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
lost connection
 
Old 03-07-2008, 09:26 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
how about replaceing the scp with echo
and try manually! perhaps try copying from s1 to . and try copying a local file to s2
and see where it failes

Edit: oh - and welcome to LQ :-P
 
Old 03-07-2008, 10:17 AM   #3
irfanb146
LQ Newbie
 
Registered: Mar 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Shell script problem

Everything is working.
First i copy from s1 to current (.) and then from current to s2. It copies it

when i do echo it is giving the right string.

There may be a problem due to security or firewall

Regards,

Irfanb146
 
Old 03-07-2008, 10:20 AM   #4
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
do you provide a password? do you have a dsa/rsa key?
if you have an dsa/rsa key, try using the -i parameter to the scp command
 
Old 03-07-2008, 11:05 AM   #5
irfanb146
LQ Newbie
 
Registered: Mar 2008
Posts: 19

Original Poster
Rep: Reputation: 0
shell Scripting

what is dsa/rsa key
 
  


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
BASH Shell script : copying a file to multiple folder zamri Programming 14 04-29-2008 11:27 AM
shell script to compare filese b/w local and remote and delete files from local serve dsids Linux - Networking 9 08-23-2006 08:20 AM
[SOLVED] Writing a shell script mattz40 Debian 5 04-13-2005 07:56 PM
writing a shell script tchoua Linux - General 8 02-24-2005 07:18 PM
Perl, script to serve files from another server Ctawp Programming 2 11-26-2004 10:07 PM


All times are GMT -5. The time now is 02:49 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