Language Selection

English French German Italian Portuguese Spanish

How to create a command-line password locker

Filed under
HowTos

Like many people, I have too many passwords to remember. To keep them straight, I wrote a simple password locker script using dialog and GnuPG (GNU Privacy Guard). The script prompts the user for a master password using a dialog box, unencrypts a file that holds a list of passwords, and opens the file in a text editor. When the editor is closed, the script re-encrypts the password file.

Dialog is an ncurses-based utility for providing text-based message and input boxes. GnuPG is a free implementation of the OpenPGP standard. Both applications are available as binary packages on Debian-based systems.

First, I had to create an encryption key using the command gpg --gen-key. I was prompted for the type of key I wanted to generate. Some keys were labeled "sign only," but I needed to use my key to encrypt data, so I selected "DSA and Elgamal" (which wasn't marked sign only). The only other important thing about the questions that followed was that I needed to remember what I typed when prompted for the "Real Name," because it is used when you encrypt.

Once I successfully generated my key, I needed to create a password file and encrypt it.

Full Story.

More in Tux Machines

Leftovers: Ubuntu

  • Snap creation tool 'snapcraft' has a new release with the groundwork for collaboration
  • Mobile Ubuntu Gamble to Fizzle Out in June
  • The Pop GTK Theme Brings Ubuntu with GNOME to Life
    If you’re looking to give your newly minted GNOME desktop a bit of a makeover look no further than the Pop GTK theme. Created by the popular Ubuntu computer seller System76, the Pop GTK theme puts a modern spin on the Ubuntu brown and orange colour scheme (which also happen to be the colours used in the System76 logo).
  • 2017 will be the year of the Linux desktop... for GNOME on Ubuntu
    A few weeks ago, Mark Shuttleworth, now CEO of Canonical, announced that the Unity desktop shell would be abandoned in favour of GNOME. While we were told that GNOME would be used by Ubuntu 18.04, we weren't sure whether it'd be included in Ubuntu 17.10, the next release. Following a meeting on IRC, we now know that GNOME will ship by default in the next release.
  • Ubuntu GNOME merged into mainline Ubuntu
    Ubuntu has been using the Unity environment developed by Caonical Ltd. since the netbook edition of Ubuntu 10.10, initially released on June 9, 2010. However, it has been decided that the Unity environment would no longer be the standard environment used for the popular GNU/Linux distro. In a blog post by Mark Shuttleworth, founder of Ubuntu and Canonical, he says, "We are wrapping up an excellent quarter and an excellent year for the company, with performance in many teams and products that we can be proud of. As we head into the new fiscal year, it’s appropriate to reassess each of our initiatives. I’m writing to let you know that we will end our investment in Unity8, the phone and convergence shell. We will shift our default Ubuntu desktop back to GNOME for Ubuntu 18.04 LTS."

today's howtos

Security Leftovers

Mesa 17.0.5