Program to transfer file 'backwards' over SSH
Background:
Computer A is behind a NAT router. Computer A can access the world, but nothing external can find its way to Computer A because of the router. Computer B is world-accessible for SSH. I can SSH and SFTP from A to B but not from B to A. The problem: I want to be able to transfer files from B to A. Is there any program out there which will let me SSH from A into B, and then from B, at the command line, send a file back to A over the already established SSH connection? I know this assumes a persistent connection, but that isn't much of an issue. I just want to be able to sit at computer A, open an SSH (or SFTP) session to B, then go over to B and be able to send files back to A. Is this possible? Thanks, Jason |
Hi.
Two ways to do this: 1) Just use sftp, and 'get' whatever you need 2) Code:
ssh user@remotehost "cat /path/to/remote/filename" > /path/to/local/filename |
Check into the -R option for ssh. It allows reverse mapping. Might be what you are after.
Brian |
If you use scp you can put the remote file on whatever side you want:
Code:
scp chadl@example.com:foo.bar . Code:
scp foo.bar chadl@example.com:. |
Quote:
The two previous posts seem to have misunderstood my point. I want to upload a file from Computer A to Computer B, where B can't connect to A, and I NO LONGER HAVE PHYSICAL ACCESS to A. -------- If you want the total, complete scenario: I am away at college, and work as a systems programmer for the university. The dorms / residential network is behind a NAT router which (obviously) doesn't allow incoming connections (to my dorm computer, herein "A"). I want to be able to access my dorm computer (A) from work (B), which has a university-wide IP. So what I need is to be able to somehow connect from A at the dorm to B at work in the morning, then go to work (using computer B), and be able to send files (or, maybe, get a shell) back to A at home (dorm). |
What about using rsync, which works over ssh.
-- Prasanta |
Use OpenVPN on both side. The server is on your work computer and the client on your home computer. You can have full IP access both directions or if you use iptables you can control access.
|
All times are GMT -5. The time now is 05:15 AM. |