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

From: Sam Watkins <sam_AT_nipl.net>
Date: Sat, 9 Feb 2013 22:32:33 +1100

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.


Sam
Received on Sat Feb 09 2013 - 12:32:33 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 09 2013 - 12:36:06 CET