Re: [dev] FTP script: how to store password?

From: markus schnalke <meillo_AT_marmaro.de>
Date: Sat, 09 Feb 2013 18:15:21 +0100

[2013-02-09 22:32] Sam Watkins <sam_AT_nipl.net>
> On Sat, Feb 09, 2013 at 12:20:58PM +0100, Hugues Moretto-Viry wrote:
> > Hi guys,
> >
> > I'm writing a little FTP client in pure shell + curl for my personal needs.
> > Anyway, I need to store my passwords so I chose SQlite, because I don't
> > want to put them in a regular file or in the script.
> > Unfortunately, I think this is not really perfect.
> >
> > Do you know how to store my passwords outside the script (maybe hashed), in
> > the suckless way?
>
> I would store them in one file per server, with key=value pairs,
> so can just 'source' the right file.
>
> e.g.
>
> filename: ftphosts/nipl.net
> content:
>
> host=nipl.net
> user=sam
> pass=whatever
>
> can have other optional keys such as 'port', and such.
>
>
> If you want a single file, you could use TSV or other tabular format,
> keep them sorted, and a binary search tool such as 'look' to find the
> right line:
>
> ai.ki sam something
> nipl.net sam whatever
>
> but I'd prefer the separate files.

This looks much like a reinvention of netrc. Netrc is already
there and widespread. Also, users know that it contains sensible
data. The things not so perfect of netrc are minor compared to
that.


meillo
Received on Sat Feb 09 2013 - 18:15:21 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 09 2013 - 18:24:04 CET