[scponly] Anyone hit file count limit in scp?

Paul Hyder Paul.Hyder at noaa.gov
Fri Aug 13 16:13:43 EDT 2004


In case someone else runs into file count restrictions:

It turns out that scponly restricts the number of wild card
expansions for a single argument on the command line
via MAX_ARGC.  (scp is the only place that scponly handles
wild card expansion itself)

Relevant code for my specific problem is in helper.c:expand_wildcards
and is called only for scp from scponly.c.

I've increased MAX_ARGC and done some testing.  Turns out to
be dangerous, it is rather easy to set it large enough that you
can accidentally exceed the scp line length.  If the line is
too long the scp quietly fails, i.e. without an error message.

I'll look into what it would take to add error messages.  That
makes more sense to me than suggesting an increase in MAX_ARGC
in the release.

Anyway if you run into scp users that want to wild card to pull
more files from an scponly host there are a couple of work arounds:

     -if sftp is available suggest that it be used instead of scp

     -CAREFULLY increase MAX_ARGC a little from the default of 100.

     -Suggest that they utilize a number of wild cards instead of
      just one "*".  (You can retrieve a larger number of files by
      being a bit more specific. For example "scp scponlyhost:files\* ."
      will recover a maximum of 97 files and using
      "scp scponlyhost:files-01\* scponlyhost:files-02\* ." will
      provide 192 of the files, two sets of 96.

Paul Hyder


Paul Hyder wrote:
> In a very vanilla configuration of scponly 3.11 I'm finding a
> file limit when I scp files to my host from the scponly host.
> [i.e. "scp scponlyhost:files\* ." where there are 900 files.]
> 
> It stops very abruptly at exactly 97 files.  File name length
> and file size don't make a difference.
> 
> Shifting to a user without scponly, using the same ssh/scp,
> works without problems.
> 
> Anyone else seen this?  Don't see anything in the email archives.
> Source code sort of looks like I'm hitting MAX_ARGC, anyone
> increased that value?
> 
> All suggestions appreciated.
>    Paul Hyder
>    NOAA Forecast Systems Lab
>    Boulder, CO




More information about the scponly mailing list