LWN.net Logo

How to create a command-line password locker (Linux.com)

How to create a command-line password locker (Linux.com)

Posted Mar 19, 2007 12:29 UTC (Mon) by sitaram (subscriber, #5959)
In reply to: How to create a command-line password locker (Linux.com) by terminator
Parent article: How to create a command-line password locker (Linux.com)

bufreadpre doesn't work for a file that doesn't exist. So when creating a *new* password file you should create it, save&close it with a blank line or something, then edit again. I.e., on the first edit of a new file, the 2 critical settings don't "take".

Also understand that if you hit Ctrl-C on the password prompt at a bad point when using :x or :wq instead of a :w, your entire file is gone :-(

Get into the habit of using :w, *then* :q. And make backups -- heck it's an encrypted file so make many of them :-)

Finally, for those of you (like me) who don't really use GPG (yeah, I know, bad net citizen and all that...) and prefer a symmetric encryption, use these commands in place of the !gpg commands above:

for BufReadPost: use "openssl bf -d -a"
for BufWritePre: use "openssl bf -salt -a"


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds