Prev: installing the tclxml/3.2 in winxp and activeTcl 8.4.1 version?
Next: Google's Go language and "goroutines"
From: Patrick on 11 Nov 2009 07:53 Before proceeding let me say yes I know I can use expect and even tcl to call the ssh client executable. Been doing that with success for some. What I would like to find out is if someone has put together a tcl extension that directly accesses the libssh2 libraries. I know that tclcurl says it does but this is for purposes of sftp file transfers. I am looking to interact with the remote host similar to the way I would if I called the ssh client via expect but without the external executable / process. It seems to be to be certainly possible, perl has net::ssh2 which does the exact thing i am looking for (I believe). It just a matter of has anyone done it yet or not? (The root of the problem is the openssh client with cygwin on windows has unacceptable startup times in my opinion, i am looking for an alternative. This is the case via command line or calling from expect). Thanks
From: Alexandre Ferrieux on 11 Nov 2009 09:40 On Nov 11, 1:53 pm, Patrick <patrick.dunni...(a)activecompliance.com> wrote: > Before proceeding let me say yes I know I can use expect and even tcl > to call the ssh client executable. Been doing that with success for > some. > > What I would like to find out is if someone has put together a tcl > extension that directly accesses the libssh2 libraries. I know that > tclcurl says it does but this is for purposes of sftp file transfers. > I am looking to interact with the remote host similar to the way I > would if I called the ssh client via expect but without the external > executable / process. > > It seems to be to be certainly possible, perl has net::ssh2 which does > the exact thing i am looking for (I believe). It just a matter of has > anyone done it yet or not? > > (The root of the problem is the openssh client with cygwin on windows > has unacceptable startup times in my opinion, i am looking for an > alternative. This is the case via command line or calling from > expect). If you mean libssl, there is the TLS extension. -Alex
From: Donal K. Fellows on 11 Nov 2009 10:09 On 11 Nov, 14:40, Alexandre Ferrieux <alexandre.ferri...(a)gmail.com> wrote: > If you mean libssl, there is the TLS extension. He means libssh2, which I'm not aware of any Tcl bindings to offhand. The thing is, for most of us just running ssh as a subprocess is "good enough" that we don't bother with anything else. However, if one is on Windows and isn't satisfied with using ssh through Cygwin, try the native windows binary plink.exe (part of putty). Donal.
From: Fandom on 11 Nov 2009 12:02 Hi, > What I would like to find out is if someone has put together a tcl > extension that directly accesses the libssh2 libraries. I know that > tclcurl says it does but this is for purposes of sftp file transfers. sftp is one of the many things I have never done with TclCurl, but why do you think it won't work' Andres
From: Patrick on 11 Nov 2009 13:34
I am not trying to do sftp and plink has its own problems (not friendly with control chars returned from linux). I would like to do something similar to the following example except instead of tcltelnet use ssh (this happens to be cisco router not prompting for the user, you get the drift). I figured this hadn't been done before, I just wanted to see what the masses had to say. Here's a link to the perl implementation: http://search.cpan.org/dist/Net-SSH2/lib/Net/SSH2.pm My guess is that this is something that would have an audience. If someone has something partially done I would love to take it further. Not sure if i have the skillset to get it going from scratch though. .... example using telnet i'd like to turn into ssh, no external executables ... package require telnet # package require tclssh instead ??? package require Expect spawn -open [telnet::open 10.0.0.21 22] #spawn -open [tclssh::connect 10.0.0.22] instead ??? expect { -re "assword: $" {} timeout { puts "timeout" exit } } exp_send "the_password\r" expect { -re ">$" { puts "Found the prompt" } } ..... and on and on ... |