Discussion:
scp via ssh tunnel howto
Luis Kornblueh
2010-07-23 07:37:28 UTC
Permalink
Hi,

I'm new to paramiko. I managed starting from demo/forward.py to build up
a ssh tunnel. I use it for accessing an subversion repository via http.
It does work great!

Now I wanted to build a second instance of a tunnel, this works as well
and I can retrieve another subversion repository.

My problem is now that I want to transfer files over the second tunnel
and not access somethin via http. What can I do in this case.

I must admit that I could start from any type of example, but have no
idea for example how to implement an SCPTunnelClient which would most
probably the best solution.

Is there anyone who could help me?

Thanks a lot,
Luis
Shem Valentine
2010-07-24 23:50:28 UTC
Permalink
I'm not sure I'm following your question completely, specifically the part
about http. However scp is very simple.

Assuming you have an active Transport() named transport.

scp = transport.open_sftp_client() # Returns an SFTPClient() session
scp.get('/source/path/on/remote', '/dest/path/on/local')

There are other methods such as 'put' for SFTPClient()
http://www.lag.net/paramiko/docs/paramiko.SFTPClient-class.html
Post by Luis Kornblueh
Hi,
I'm new to paramiko. I managed starting from demo/forward.py to build up
a ssh tunnel. I use it for accessing an subversion repository via http.
It does work great!
Now I wanted to build a second instance of a tunnel, this works as well
and I can retrieve another subversion repository.
My problem is now that I want to transfer files over the second tunnel
and not access somethin via http. What can I do in this case.
I must admit that I could start from any type of example, but have no
idea for example how to implement an SCPTunnelClient which would most
probably the best solution.
Is there anyone who could help me?
Thanks a lot,
Luis
Loading...