tags:

views:

574

answers:

1

I am using shell script scp command to move one file from one server to another using ssh. My command looks like this:

scp -P 23 -i $TEST_SSHKEY $DESTINATION_PATH/$FILETOCOPY $USER_ID@$SERVER_BOX:

File is copying but scp is returning return code as 1.

Why it is happening and what is the solution for this?

A: 

G'day,

Try enabling verbose mode (-v) to see more details of what's going on rather than just looking at a return code of 1 which means "something bad happened".

HTH

cheers,

Rob Wells
Thanks for your responses but verbose output is returning -1 exit status.
@prathibha, have you tried the other forms of the command? ssh -P 23 -i .... -2 to use protocol 2 only? or try specifiying the user as -l <user> <host> instead of <user>@<host>
Rob Wells