cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libssh2 scp working?

From: James Housley <jim_at_thehousleys.net>
Date: Mon, 16 Oct 2006 10:24:44 -0400

On Oct 16, 2006, at 7:03 AM, Daniel Stenberg wrote:

> On Mon, 16 Oct 2006, James Housley wrote:
>
>>> - When built, it doesn't seem to work for me to scp from my test
>>> server? So
>>> I switched to try sftp instead and then I noticed that you have
>>> a wrong
>>> assumption on the given URL:
>>
>> Right now scp works if you have copied your public key to the
>> server. It should work if you pass the password on the command
>> line. I also don't know if works with SSHv1.
>
> I only use SSH2 (libssh2 is only claimed to support SSH2 anyway)
> and I can't make it work with publickey nor with password
> authentication against my servers. But I haven't debugged it at
> all, it may just be someting silly.
>
>>> == Info: Couldn't open file /tmp/temp
>
>>> ... which indicates that you use the initial slash when creating
>>> the path,
>>> while that should be used as a separator only! If I really
>>> wanted the root
>>> tmp dir, I would use "//tmp/temp" or even "/%2etmp/temp". (The
>>> latter is
>>> the way the RFCs dictate.)
>>
>> This is one of the things I want to talk about.
>>
>> I use scp a lot and my most common usage is
>>
>> scp username_at_server:~/filename .
>
> Well, we can't use scp as a means to compare with since scp is in
> no way trying to use URL syntax for its arguments. In fact, that
> file name is passed to the remote shell and relies on the shell's
> globbing for the ~ treatment etc.
>
> Here's the latest attempt at a standard for SCP/SFTP URI format:
>
> http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-04
>

To quote from http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-
ssh-uri-04#section-6

   Retrieve file.txt from the user's home directory on the host at
    host.example.com using SFTP using username user. This example
    assumes that the implementation supports the indication of a path
    relative to the home directory using a leading tilde.

         sftp://user@host.example.com/~/file.txt

    Retrieve file.txt from the absolute path /dir/path on the host at
    host.example.com using SFTP using username user.

         sftp://user@host.example.com/dir/path/file.txt

Seems to state all paths are absolute.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?
Received on 2006-10-16