lars
2005-Apr-12 18:43 UTC
ssh to target, scp back to source in same session without name resolution
Dear OpenSSH-Team, First, thanks a lot for your efforts on OpenSSH, great job! I have a wish: I'd like to be able to connect from my source to a target via ssh, do some stuff on the target, and then copy back some files to the source, all within the same session and without name resolution. "Problem": I'm behind a firewall with my source host, I don't know the name or location of some files/directories on the target host, I ssh to the target host on the internet, look for and find these files/directories (but I don't want to open a second session for scp and I can't resolve the name of my source host behind the firewall), and then I'd like to copy those files back to my source host, within the same encrypted session. Do you understand what I mean? I don't think this is possible at the moment, unless I haven't read the manual well enough. Ok, that's all, thanks for reading. Kind regards, Lars.
Peter Stuge
2005-Apr-12 23:02 UTC
ssh to target, scp back to source in same session without name resolution
On Tue, Apr 12, 2005 at 08:43:23PM +0200, lars wrote:> I ssh to the target host on the internet, > look for and find these files/directories > (but I don't want to open a second session for scp and > I can't resolve the name of my source host behind the firewall), > and then I'd like to copy those files back to my source host, > within the same encrypted session. > > Do you understand what I mean? > > I don't think this is possible at the moment, > unless I haven't read the manual well enough.Should be possible using connection sharing. See -S in ssh(1) and ControlMaster/ControlPath in ssh_config(5) and check mailing list archive the last few months. //Peter
Bob Proulx
2005-Apr-13 08:31 UTC
ssh to target, scp back to source in same session without name resolution
lars wrote:> "Problem": > I'm behind a firewall with my source host, > I don't know the name or location of some files/directories on the > target host,This is a bash specific suggestion. It probably works with other shells that also have command completion. Use file name expansion to see the name of the file you want to copy. . /etc/bash_completion scp user at remote:/some/path<TAB><TAB> At the TAB the shell as configured by the completion will ssh to the remote host and get a directory listing as if it were expanding a local path. Find the file you want, select it and then copy it locally. scp user at remote:/some/path/to/file . Depending upon the speed of the hosts involved this either is either very fast or possibly quite slow. You will need to be managing ssh keys with an agent or it will prompt you repeatedly for passwords. But it is a pretty nice feature. Bob
Possibly Parallel Threads
- [Bug 2621] New: ControlMaster started by scp (non-ssh?) doesn't forward agent
- ControlMaster, scp and current working directory
- Feature requests for scp and ssh
- How create multiples ssh on same host without asking same password
- ControlPath versus ProxyCommand