scp between 2 servers - invoked at 3rd server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting scp between 2 servers - invoked at 3rd server
# 1  
Old 06-23-2006
scp between 2 servers - invoked at 3rd server

I have a couple of servers that can't see each other and need to copy files from one to the other. I try to invoke scp from a 3rd server that can see both servers - get error msgs that are cryptic.

from server C
I can do
scp user@serverA:~/file .
scp file user@serverB:~

but if I try to do:
scp user@serverA:~/file user@serverB:~
I get prompted for password on Server A, but then fail with permission denied on serverB

I captured the verbose output of this last command, but cannot see why it does not prompt me for the password on ServerB

$> scp -v ctsjsie@fxlddb01:~/xxx.lst ctsjsie@hstas05:~
Executing: /usr/local/bin/ssh -v -x -o'ClearAllForwardings yes' -n -l ctsjsie fxlddb01 scp -v ~/xxx.lst 'ctsjsie@hstas05:~'
OpenSSH_3.7.1p2-pwexp26, SSH protocols 1.5/2.0, OpenSSL 0.9.7c 30 Sep 2003
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Applying options for *
debug1: /usr/local/etc/ssh_config line 42: Deprecated option "FallBackToRsh"
debug1: Connecting to fxlddb01 [167.113.228.23] port 22.
debug1: Connection established.
debug1: identity file /home/ctsjsie/.ssh/identity type -1
debug1: identity file /home/ctsjsie/.ssh/id_rsa type -1
debug1: identity file /home/ctsjsie/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p2-pwexp26
debug1: match: OpenSSH_3.7.1p2-pwexp26 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p2-pwexp26
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'fxlddb01' is known and matches the RSA host key.
debug1: Found key in /home/ctsjsie/.ssh/known_hosts:4
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ctsjsie/.ssh/identity
debug1: Trying private key: /home/ctsjsie/.ssh/id_rsa
debug1: Offering public key: /home/ctsjsie/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
ctsjsie@fxlddb01's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v /home/ctsjsie/xxx.lst ctsjsie@hstas05:~
Executing: program /usr/local/bin/ssh host hstas05, user ctsjsie, command scp -v -t ~
OpenSSH_3.7.1p2-pwexp26, SSH protocols 1.5/2.0, OpenSSL 0.9.7c 30 Sep 2003
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Applying options for *
debug1: /usr/local/etc/ssh_config line 42: Deprecated option "FallBackToRsh"
debug1: Connecting to hstas05 [172.19.69.123] port 22.
debug1: Connection established.
debug1: identity file /export/home/ctsjsie/.ssh/identity type -1
debug1: identity file /export/home/ctsjsie/.ssh/id_rsa type -1
debug1: identity file /export/home/ctsjsie/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p2-pwexp26
debug1: match: OpenSSH_3.7.1p2-pwexp26 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p2-pwexp26
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'hstas05' is known and matches the RSA host key.
debug1: Found key in /export/home/ctsjsie/.ssh/known_hosts:13
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/ctsjsie/.ssh/identity
debug1: Trying private key: /export/home/ctsjsie/.ssh/id_rsa
debug1: Trying private key: /export/home/ctsjsie/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.

debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,password,keyboard-interactive).
debug1: Calling cleanup 0x4001fb12(0x0)
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
lost connection
debug1: channel 0: free: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 5.6 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1

Last edited by bigjohn-nj; 06-23-2006 at 12:54 PM..
# 2  
Old 06-26-2006
Your trying to go from server C with one command thru server A and get a file from B all at the same time. Why don't you just log in A with SSH. The do an scp from A to B and see if that works.

Also, It looks like your sshd_config file excepts keys or passwords so there shouldn't be any issue there.

-X
# 3  
Old 06-26-2006
Thanks X,

Unfortunately, as I indicated A & B cannot see each other. Both of these servers are located outside of our firewall at 2 different sites. Server C is located inside the firewall on our internal network and CAN see both server A & Server B - I was hoping to copy files from A to B by way of C in a "single hop" - Beginning to look like I can't do it this way......
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want to scp file from one server to another, both server have different user name and

i want to scp file from one server to another. both server have different user name and it needs to give password to transfer file.how can we mention password in the script itself so that we need not mention password while running the script. Say from servers cpli with user abc and file path /opt... (7 Replies)
Discussion started by: Moon1234
7 Replies

2. Shell Programming and Scripting

How to scp File from root user in one server to say crt user in another server and avoid password?

Can someone help in writing some script through which I can transfer file (scp) from root user in abc server to crt user in hfg server and can give the crt user password in script itself so that it doesn't prompt me every time for password (4 Replies)
Discussion started by: Moon1234
4 Replies

3. Shell Programming and Scripting

Automate scp between servers

Hello, Could someone please help me with the below requirement? I need to automate scp files between two servers. I have a file having server names and paths to the folder like below server1 /path/to/folder/ server1 /path/to/folder/ server1 /path/to/folder/ server2 /path/to/folder/... (4 Replies)
Discussion started by: Kochappa
4 Replies

4. Shell Programming and Scripting

scp without password between two servers

Hello Folks, I have two linux server accounts server1 and server2 From the terminal if I say this command, scp /source/folder/from/server1/unix.txt user@server2.com:/destination/folder/ Then it prompts for the password user@server2.com's password: I enter my password and then it... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

5. Shell Programming and Scripting

scp to same server

Suppose I am in server A . I have a file at one location in server A and I want to do scp of the file to same server A but to different location without asking password ( passwordless login to same server) .Pls help (1 Reply)
Discussion started by: maitree
1 Replies

6. UNIX for Advanced & Expert Users

scp a partition to another server

I am in the process of migrating a server to another machine. Without much thought, i just copied one partition to the other server using, simple scp in at job which ended up in mess. scp -r /mnt/sda6/* root@IP:/mnt/sda9/ At first sight, it seemed correct. So i did this, for all the... (1 Reply)
Discussion started by: thegeek
1 Replies

7. Shell Programming and Scripting

Script to SCP a file to multiple servers

Hi All, I am a total noob to the Unix world, and i hope to learn a lot from this wonderful community. Here's my first post and question , i am trying to SCP a file to multiple servers (multiple destinations) through this little script : #!/bin/ksh # copy files # File to be copied... (7 Replies)
Discussion started by: rdlover
7 Replies

8. Shell Programming and Scripting

SCP logfiles from one server to another server

Hi, I want to copy all the logs except current date logs from one server to another server every day, so i want to write a script for it and put it in crontab. Can anyone help how to write the script. Regards, Srini (1 Reply)
Discussion started by: srinivasvandana
1 Replies

9. Shell Programming and Scripting

Scp between two servers

Is there a way to connect betwwen two servers A and B without using prompting for a password ..... I am writing a script which includes picking up files from and puts them to B. using mget .. To make the script fully automable I am looking for a passwordless authentication... Any... (2 Replies)
Discussion started by: ultimatix
2 Replies

10. UNIX for Dummies Questions & Answers

Unable to scp/sftp between two servers

I have four servers that for all intents and purposes are the same (I have the same profile on all four), North, South, Brooklyn & Queens. I have a script that scp's a file from Queens to brooklyn, and it runs just fine. I tried to replicate the script on South, to transfer a file to North, and... (1 Reply)
Discussion started by: DeCoTwc
1 Replies
Login or Register to Ask a Question