LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Writing a shell script for copying file from one server to other by using third serve (https://www.linuxquestions.org/questions/linux-newbie-8/writing-a-shell-script-for-copying-file-from-one-server-to-other-by-using-third-serve-626374/)

irfanb146 03-07-2008 06:50 AM

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

Nathanael 03-07-2008 09:26 AM

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

irfanb146 03-07-2008 10:17 AM

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

Nathanael 03-07-2008 10:20 AM

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

irfanb146 03-07-2008 11:05 AM

shell Scripting
 
what is dsa/rsa key


All times are GMT -5. The time now is 10:28 AM.