AuthorizedKeysCommand size issue?

Yves Dorfsman yves at zioup.com
Wed Apr 16 03:05:27 EST 2014


On 2014-04-15 10:57, Dag-Erling Smørgrav wrote:
> Yves Dorfsman <yves at zioup.com> writes:
>> Dag-Erling Smørgrav <des at des.no> writes:
>>> Shouldn't 'curl ... | cat' suffice?
>> Tried that before, it returns an exit code 141.
>
> What returns exit code 141?

I suspect bash is returning the exit code from cat.


> If the curl command line you're using normally prints the file to
> stdout, then curl | cat will do exactly the same, cat will buffer it.

I agree, and that's why I tried it early on, I'm not sure where the problem is 
there.

> However, the command line you're using will _not_ print the file to
> stdout.

No, curl output to stdout by default.

> Uh, echo does not interpret the $ sign.  The shell does, and you want it
> to.

Darn, decades of UNIX and I still run into this! I feel terrible...

   $() is equivalent to ``, so entire construct is replaced with
> whatever curl outputs.  Note that the double quotes ensure that the
> entire output is passed to echo as a single argument, rather than split
> into words, thus preserving whitespace.

Yes, adding the double quotes around it worked. Thanks. This actually is a 
very elegant work around, both in terms of speed and security.

-- 
Yves.



More information about the openssh-unix-dev mailing list