yes, fruch is right.

thomas, first of all, i really appreciate your (and gerald's) effort, and
would like to thank you guys for this code contribution, but sadly it's not
going to get into the official release. i don't mind at all adding a link to
your patched version on the site's download section, but it's too platform
dependent to be useful in the general case.

i do plan to add ssh support to rpyc, though. ssh is very easy to use and
powerful, which makes it a desired transport (way easier than ssl, for
instance). however, i'm planning to use tunneling instead of the std pipes,
which would make it cross-platform.

it will work by first spawning the desired rpyc server on the host, e.g.,
ssh myhost /foo/bar/rpyc_server.py --host=localhost --port=12345

then it would set up an ssh tunnel , e.g.,
ssh myhost -L 23456:localhost:12345

now the client will connect to localhost:23456, which would be securely
forwarded to myhost:12345, and everyone would be happy.

i think i'd use paramiko or pylibssh2 when available, and fall back to the
executable ssh client.


any comments are welcome.

-tomer

An NCO and a Gentleman


On Tue, Apr 12, 2011 at 07:20, Fruch <[email protected]> wrote:

> I was looking on Paramiko (http://www.lag.net/paramiko/)
> and was thinking maybe we could do the automatic remote server creation
> with it.
>
> In a way that it would be platform interdependent, cause the
> current solution (that thomas add, and i'm not saying it a bad one, it's
> quite nifty) will work only under linux flavor python.
>
> yes the paramikio is depended on pycrypto which is not a pure python
> this means that the user would need to install a binary package, or compile
> it on it's own.
>
> I thought of something like that: [it's totally pseudo code, and it's not
> working on win32, cause paramiko files(stdout,stdin), are not behaving like
> a win32pipe]
>
> # paramiko.sftpclient to send the Rpyc module remotely
> t = paramiko.Transport((hostname, port))
> t.connect(username=username, password=password, hostkey=hostkey)
> sftp = paramiko.SFTPClient.from_transport(t)
> # TODO: handle the file that needed to be sent away
>
> #paramiko.sshclient to start the process on the other side
> ssh = paramiko.SSHClient()
> ssh.load_system_host_keys()
> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
> ssh.connect(hostname="127.0.0.1", port=port, username=username,
> password=password)
> ssh.invoke_shell()
> #TODO: better way of starting rpyc, maybe using SSL sockets
> command = """python -c "import rpyc
> rpyc.classic.connect_stdpipes().serve_all()"
> """
> stdin, stdout, stderr = ssh.exec_command(command)
>
> # start the client side
> c = rpyc.Connection(rpyc.SlaveService,
>             rpyc.Channel(rpyc.PipeStream(stdout, stdin)),{})
>
>
> any thoughts ? or to make it actually work, and easy to use ?
>
> Fruch
>

Reply via email to