From: Vagif Verdi
Subject: SSH lisp library
Date: 
Message-ID: <2eddfd68-a627-4e2f-97bf-df17a5a1c121@p39g2000prm.googlegroups.com>
Is there an ssh lisp library ? The only reason i'm using python
scripts for some of my tasks is because there's an ssh python library
that allows me to connect to remote sftp servers and upload some
files.

From: Pascal J. Bourguignon
Subject: Re: SSH lisp library
Date: 
Message-ID: <7cskwl13t8.fsf@pbourguignon.anevia.com>
Vagif Verdi <···········@gmail.com> writes:

> Is there an ssh lisp library ? The only reason i'm using python
> scripts for some of my tasks is because there's an ssh python library
> that allows me to connect to remote sftp servers and upload some
> files.

(with-open-stream (stream 
                  #+clisp (ext:run-program "ssh"
                               :arguments (list (format nil ···@~A" "pjb" "localhost")
                                                "bash"
                                                "-c" 
                                                (format nil "\"cat > ~S\"" "test"))
                               :input :stream :output :terminal))
  (princ "Hello world!" stream)
  (terpri stream)
  (finish-output stream))

Something similar can be done in most implementations.

                                                
-- 
__Pascal Bourguignon__
From: Alex Mizrahi
Subject: Re: SSH lisp library
Date: 
Message-ID: <482ada21$0$90272$14726298@news.sunsite.dk>
 ??>> Is there an ssh lisp library ? The only reason i'm using python
 ??>> scripts for some of my tasks is because there's an ssh python library
 ??>> that allows me to connect to remote sftp servers and upload some
 ??>> files.

 PJB> (with-open-stream (stream
 PJB>                   #+clisp (ext:run-program "ssh"
 PJB>                             :arguments (list (format nil ···@~A" "pjb"
 PJB> "localhost")
 PJB>                                                 "bash"
 PJB>                                                 "-c"
 PJB>                                             (format nil "\"cat > ~S\""
 PJB> "test"))
 PJB>                                :input :stream :output :terminal))
 PJB>   (princ "Hello world!" stream)
 PJB>   (terpri stream)
 PJB>   (finish-output stream))

 PJB> Something similar can be done in most implementations.

for sftp it's even easier -- just call scp program, it uploads files just 
fine 
From: Vagif Verdi
Subject: Re: SSH lisp library
Date: 
Message-ID: <693c4087-5879-4ef4-9872-ae7b53b75cee@m45g2000hsb.googlegroups.com>
On May 14, 5:13 am, ····@informatimago.com (Pascal J. Bourguignon)
wrote:
> Vagif Verdi <···········@gmail.com> writes:
> > Is there an ssh lisp library ? The only reason i'm using python
> > scripts for some of my tasks is because there's an ssh python library
> > that allows me to connect to remote sftp servers and upload some
> > files.
>
> (with-open-stream (stream
>                   #+clisp (ext:run-program "ssh"
>                                :arguments (list (format nil ···@~A" "pjb" "localhost")
>                                                 "bash"
>                                                 "-c"
>                                                 (format nil "\"cat > ~S\"" "test"))
>                                :input :stream :output :terminal))
>   (princ "Hello world!" stream)
>   (terpri stream)
>   (finish-output stream))
>
> Something similar can be done in most implementations.
>
> --
> __Pascal Bourguignon__

You can't be serious. What about error handling ? reading remote
folders ?
I do not wanna parse terminal output. Better stay with python.

But thanks for the answer. I got information i was looking for. There
are no lisp ssh libraries.
From: Andreas Hinze
Subject: Re: SSH lisp library
Date: 
Message-ID: <692cp4F2uf2tmU1@mid.uni-berlin.de>
Vagif Verdi schrieb:
>
> But thanks for the answer. I got information i was looking for. There
> are no lisp ssh libraries.
>
>
Hi

This is not really true.
All implementations have a kind of foreign language interface that can be used 
to connect to i.e. openssl libs as in most other languages too. So all you need
to do is to write the FLI binding (or google for one). Thats btw. is the
same way Python (and various other languages) provide ssl.

However, it is  possible that there is no native lisp implementation of ssl. But i
assume thats only because no one find any advantage in that. Ever thought about 
(complete) verification of such a beast?
And as far as i know there are no native implementations in Perl/Python/Ruby.

Have you any good reason for a native implementation? I'm sure cll readers will happily support
your work if you decide to make one.

Finally, if you don't want to implement ssl by yourself and even don't want to create FLI
bindings, you are free to use a comercial Lisp. LispWorks for example comes with build-in 
ssh support (and a lot of other goodies). I'm sure other comercial Lisps provide similar tools.

Regards
AHz
From: Edi Weitz
Subject: Re: SSH lisp library
Date: 
Message-ID: <ud4noexsz.fsf@agharta.de>
On Thu, 15 May 2008 11:06:44 +0200, Andreas Hinze <···@snafu.de> wrote:

> Vagif Verdi schrieb:
>>
>> But thanks for the answer. I got information i was looking
>> for. There are no lisp ssh libraries.
>
> Hi
>
> This is not really true.
> All implementations have a kind of foreign language interface that
> can be used to connect to i.e. openssl libs as in most other
> languages too. So all you need to do is to write the FLI binding (or
> google for one). Thats btw. is the same way Python (and various
> other languages) provide ssl.
>
> However, it is possible that there is no native lisp implementation
> of ssl. But i assume thats only because no one find any advantage in
> that. Ever thought about (complete) verification of such a beast?
> And as far as i know there are no native implementations in
> Perl/Python/Ruby.
>
> Have you any good reason for a native implementation? I'm sure cll
> readers will happily support your work if you decide to make one.
>
> Finally, if you don't want to implement ssl by yourself and even
> don't want to create FLI bindings, you are free to use a comercial
> Lisp. LispWorks for example comes with build-in ssh support (and a
> lot of other goodies). I'm sure other comercial Lisps provide
> similar tools.

I think you're confusing SSL and SSH here.  LispWorks has built-in SSL
support (which is nevertheless based on the C libs) and there are
portable open-source bindings like David Lichteblau's CL+SSL.  But
AFAIK the OP is right that there are no Lisp libraries which support
SSH.

Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Andreas Hinze
Subject: Re: SSH lisp library
Date: 
Message-ID: <692eo6F2vrosvU1@mid.uni-berlin.de>
Edi Weitz wrote:

> 
> I think you're confusing SSL and SSH here.  LispWorks has built-in SSL
> support (which is nevertheless based on the C libs) and there are
> portable open-source bindings like David Lichteblau's CL+SSL.  But
> AFAIK the OP is right that there are no Lisp libraries which support
> SSH.
> 
> Edi.
> 
Hi Edi

Yes you are right (i never needed to use ssh/ssl from LispWorks so i remember
not exactly).

However, it should not be harder to implement in Lisp (using FLI bindings to
openssl) than in any other language. 

Regards
Andreas
From: D Herring
Subject: Re: SSH lisp library
Date: 
Message-ID: <Je6dnbRqS6EzzrPVnZ2dnUVZ_rLinZ2d@comcast.com>
Andreas Hinze wrote:
> Edi Weitz wrote:
>> I think you're confusing SSL and SSH here.  LispWorks has built-in SSL
>> support (which is nevertheless based on the C libs) and there are
>> portable open-source bindings like David Lichteblau's CL+SSL.  But
>> AFAIK the OP is right that there are no Lisp libraries which support
>> SSH.
> 
> Yes you are right (i never needed to use ssh/ssl from LispWorks so i remember
> not exactly).
> 
> However, it should not be harder to implement in Lisp (using FLI bindings to
> openssl) than in any other language. 

Still no; there's libssl but no libssh on most systems...  SSL was 
designed for library use; SSH was not.  OpenSSH (and presumably 
others) rabidly avoid linking against untrusted code.

The Python SSH the OP mentioned is actually an entire SSH stack 
written on top of the Twisted library.  Whether its as secure as the 
others is debatable, but it is usable.

Python also had some expect-style shell interaction libraries (e.g. 
PySSH); but I don't think these are actively developed since the 
Twisted library became available.

- Daniel
From: Pascal J. Bourguignon
Subject: Re: SSH lisp library
Date: 
Message-ID: <7c1w4323p4.fsf@pbourguignon.anevia.com>
Vagif Verdi <···········@gmail.com> writes:

> On May 14, 5:13 am, ····@informatimago.com (Pascal J. Bourguignon)
> wrote:
>> Vagif Verdi <···········@gmail.com> writes:
>> > Is there an ssh lisp library ? The only reason i'm using python
>> > scripts for some of my tasks is because there's an ssh python library
>> > that allows me to connect to remote sftp servers and upload some
>> > files.
>>
>> (with-open-stream (stream
>>                   #+clisp (ext:run-program "ssh"
>>                                :arguments (list (format nil ···@~A" "pjb" "localhost")
>>                                                 "bash"
>>                                                 "-c"
>>                                                 (format nil "\"cat > ~S\"" "test"))
>>                                :input :stream :output :terminal))
>>   (princ "Hello world!" stream)
>>   (terpri stream)
>>   (finish-output stream))
>>
>> Something similar can be done in most implementations.
>
> You can't be serious. 

Yes very serrious.

> What about error handling ? reading remote
> folders ?

You could implement all that, or port tramp from emacs lisp to Common Lisp.


> I do not wanna parse terminal output. Better stay with python.

I don't see how you would avoid it with a lisp function. What would
  (ssh :login "user" :host "remote" :command "ls" :arguments '("-l"))
return?

> But thanks for the answer. I got information i was looking for. There
> are no lisp ssh libraries.

Is there a C ssh library?  If there is one, then there is a lisp
one. Just use CFFI to call functions in the C ssh library.

-- 
__Pascal Bourguignon__
From: ·············@gmail.com
Subject: Re: SSH lisp library
Date: 
Message-ID: <dea829c2-f0b6-49ea-9d55-a380d9c0dff9@u12g2000prd.googlegroups.com>
On 15 Mai, 18:43, ····@informatimago.com (Pascal J. Bourguignon)
wrote:

> Is there a C ssh library?

Couldn't find anything useable when i looked last time. Curl but this
is total
crap, almost as less control as calling "ssh" or "scp". Useless for
anything other then HTTP.
From: Alex Mizrahi
Subject: Re: SSH lisp library
Date: 
Message-ID: <482c658d$0$90271$14726298@news.sunsite.dk>
 VV> You can't be serious. What about error handling ? reading remote
 VV> folders ?
 VV> I do not wanna parse terminal output. Better stay with python.

 VV> But thanks for the answer. I got information i was looking for. There
 VV> are no lisp ssh libraries.

there is. tramp. last time i've checked emacs lisp is lisp. 
From: Vagif Verdi
Subject: Re: SSH lisp library
Date: 
Message-ID: <52436f58-faf8-4c80-887f-124f1d6b735f@l17g2000pri.googlegroups.com>
On May 15, 9:32 am, "Alex Mizrahi" <········@users.sourceforge.net>
wrote:
>  VV> You can't be serious. What about error handling ? reading remote
>  VV> folders ?
>  VV> I do not wanna parse terminal output. Better stay with python.
>
>  VV> But thanks for the answer. I got information i was looking for. There
>  VV> are no lisp ssh libraries.
>
> there is. tramp. last time i've checked emacs lisp is lisp.

I should have been more specific: sbcl

To those who says "use FFI":
Yes I know that to every question about any possible feature or
library you can always answer FFI. But unless you have a ready
bindings, that answer is useless. I did know about FFI without your
help.
I'm looking for readily available solution. Does not matter in which
form, native library or FFI bindings. If there's no such thing just
say it. I'll figure out FFI part myself.
From: Pascal J. Bourguignon
Subject: Re: SSH lisp library
Date: 
Message-ID: <7c8wyazosl.fsf@pbourguignon.anevia.com>
Vagif Verdi <···········@gmail.com> writes:

> On May 15, 9:32 am, "Alex Mizrahi" <········@users.sourceforge.net>
> wrote:
>>  VV> You can't be serious. What about error handling ? reading remote
>>  VV> folders ?
>>  VV> I do not wanna parse terminal output. Better stay with python.
>>
>>  VV> But thanks for the answer. I got information i was looking for. There
>>  VV> are no lisp ssh libraries.
>>
>> there is. tramp. last time i've checked emacs lisp is lisp.
>
> I should have been more specific: sbcl
>
> To those who says "use FFI":
> Yes I know that to every question about any possible feature or
> library you can always answer FFI. But unless you have a ready
> bindings, that answer is useless. I did know about FFI without your
> help.

I mentionned CFFI.  You don't need ready bindings, CFFI elaborates its
bindings automatically from the header files. Unless the C headers are
pathologic, this should give you an usable entry point.


> I'm looking for readily available solution. Does not matter in which
> form, native library or FFI bindings. If there's no such thing just
> say it. I'll figure out FFI part myself.

-- 
__Pascal Bourguignon__
From: Vagif Verdi
Subject: Re: SSH lisp library
Date: 
Message-ID: <6447c9a1-c50b-431e-b5ba-e686449396c3@l28g2000prd.googlegroups.com>
On May 16, 12:33 am, ····@informatimago.com (Pascal J. Bourguignon)
wrote:

> I mentionned CFFI.  You don't need ready bindings, CFFI elaborates its
> bindings automatically from the header files. Unless the C headers are
> pathologic, this should give you an usable entry point.

Thanks, i did not know it. I'll check cffi documentation.
From: D Herring
Subject: Re: SSH lisp library
Date: 
Message-ID: <0vednfpKkJQMy7PVnZ2dnUVZ_tLinZ2d@comcast.com>
Vagif Verdi wrote:
> Is there an ssh lisp library ? The only reason i'm using python
> scripts for some of my tasks is because there's an ssh python library
> that allows me to connect to remote sftp servers and upload some
> files.

No SSH/SFTP library proper, but cl-curl may be usable if you're just 
uploading files over sftp.  Newer curl libraries are SFTP-compatible, 
I believe using libssh2.

http://common-lisp.net/project/cl-curl/
http://www.libssh2.org

- Daniel