Hi All, I am running openssh (OpenSSH_2.9p1, SSH protocols 1.5/2.0). The scenario is that I have got three machines (A, B and C). The sshd on host A is listensing on port 1234, and the sshd on host B is listensing on port 5678. How can I set up a scp from a third host C so as to copy a file from host A to host B? scp -P 1234 myname at A:/var/tmp/file1 -P 5678 myname at B:/var/tmp/file1 does not work and C always try to connect to sshd on A at port 22. Rgds. Bob Shih PLEASE READ: The information contained in this email is confidential and intended for the named recipient(s) only. If you are not an intended recipient of this email you must not copy, distribute or take any further action in reliance on it and you should delete it and notify the sender immediately. Email is not a secure method of communication and Nomura International plc cannot accept responsibility for the accuracy or completeness of this message or any attachment(s). Please examine this email for virus infection, for which Nomura International plc accepts no responsibility. If verification of this email is sought then please request a hard copy. Unless otherwise stated any views or opinions presented are solely those of the author and do not represent those of Nomura International plc. This email is intended for informational purposes only and is not a solicitation or offer to buy or sell securities or related financial instruments. Nomura International plc is regulated by the Financial Services Authority and is a member of the London Stock Exchange.
On Fri, Jan 18, 2002 at 03:53:58PM -0000, Shih, Robert wrote:> I am running openssh (OpenSSH_2.9p1, SSH protocols 1.5/2.0). The scenario > is that I have got three machines (A, B and C). The sshd on host A is > listensing on port 1234, and the sshd on host B is listensing on port 5678. > How can I set up a scp from a third host C so as to copy a file from host A > to host B?You'll have to be creative, I think.> scp -P 1234 myname at A:/var/tmp/file1 -P 5678 myname at B:/var/tmp/file1ssh -p 1234 myname at A "scp -P 5678 /var/tmp/file1 myname at B:/var/tmp/file1" You'd probably need to use keypair, shosts, etc. to authenticate A -> B. ssh -p 1234 myname at A "cat /var/tmp/file1" | ssh -p 5678 myname at B "cat > /var/tmp/file1" I think either of those tricks would work. The first is more efficient, as the data only crosses the network once, but authentication may be sticky; it doesn't work for me if A -> B needs interactive password authentication. The second is more likely to work easily, but the file had to go through A -> C and C -> B, which is a waste of bandwidth, and might not work, as you never said whether C could communicate directly with B. The second trick definitely works, though with my 2.5.2p2 systems, using password auth for both C -> A and C -> B connections, my terminal prompts me for both passwords on the same line. I enter one, press return, and then the other, ad pres return. The second password I type is echoed to my screen. Oops. Maybe someone could try that with the latest release and/or CVS? -Peter
Reasonably Related Threads
- Bug when using cygwin version of rsync (forwarded to rsync list)
- Changing file permissions from the command line
- Cannot join Windows server; SWAT internal error
- 2.9p1 SCO OS 5.0.5 server and Linux client hang on exit when using X11 forwarding and protocol 2
- HPUX: ssh hangs after shell exit