VOOZH about

URL: https://thenewstack.io/linux-pass-a-text-based-password-manager/

⇱ Linux Pass: A Text-Based Password Manager - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-03-02 06:00:28
Linux Pass: A Text-Based Password Manager
Linux / Security

Linux Pass: A Text-Based Password Manager

Once you get the hang of pass, you'll find it to be an outstanding option for those machines that don't include a GUI but still need a password manager.
Mar 2nd, 2024 6:00am by Jack Wallen
👁 Featued image for: Linux Pass: A Text-Based Password Manager
Feature image by Willgard Krause from Pixabay.

Linux servers typically don’t tend to install with GUIs. A command line is faster.

But when you have no GUIs to rely on, what do you do about passwords?

Because this is Linux, there’s always a solution. In this case, the solution is pass, which is a text-based password manager that stores all of your entries in the PGP-encrypted text file, ~/.password-store.

The pass command gives you access to adding, editing, generating, and retrieving your stored passwords and can even temporarily add a password to your clipboard and track password changes with git.

Yeah, pass is handy and it’s something you’re going to want to have at the ready.

I’m going to walk you through the process of installing and using the pass text-based password manager.

What You’ll Need

I’m going to demonstrate this on Ubuntu Server 22.04, but pass is also available for Fedora-based distributions. The only difference is the installation command (which I’ll explain in a bit). You’ll also need a user with sudo privileges for the installation and a PGP key generated and stored on the machine (I’ll explain how to do this as well).

Do note, that pass can also be installed on MacOS via Homebrew.

That’s it. Let’s get pass installed.

Installing Pass

The first step is installing pass. Log in to your Ubuntu server and issue the command:

sudo apt-get install pass -y

If you’re using a Fedora-based machine, that command will be:

sudo dnf install pass -y

Generating Your PGP Key

Next, we need to generate a PGP key that will be used with pass. To do this, go back to the terminal and issue the command:

gpg --gen-key

Answer the required questions to complete the process. One of the questions asked will be to require you to type an email address to associate with the key. You’ll need that email address during the pass setup.

Setting up Pass

With your gpg key at the ready, it’s time to initialize pass with the command:

pass init EMAIL

Where EMAIL is the email address you associated with your PGP key. This will create a new password store and initialize it for the email address.

Using Pass

With everything ready, it’s time to create your first entry into your pass password store. Let’s say you want to add a password for Facebook. To do that, we’re going to not only create an entry for Facebook but also a folder to house Social networking sites. For that, the command would be:

pass insert SOCIAL/Facebook

You’ll be prompted to type a password for the Facebook entry. If you wanted to associate a username with that account, you could do something like this:

pass insert SOCIAL/Facebook/USERNAME

Where USERNAME is the username for the Facebook account in question.

When you want to view the password for the account, issue the command:

pass show SOCIAL/Facebook/USERNAME

To successfully view the password, you’ll have to type the passphrase associated with the GPG key used to initialize the password store.

Let’s say you also want to add an entry for Twitter (aka X) and you want it also stored in the SOCIAL category. For that, the command would be:

pass edit SOCIAL/Twitter/USERNAME

Where USERNAME is the Twitter/X username.

To view the layout of your password store, issue the command:

pass

The results will look something like this:

Password Store

├── APIx
│   └── jack
└── SOCIAL
├── Facebook
│   └──jack
├── Facebook
└── Twitter
└── jack

You can also use pass to generate random passwords (which can then be used to create new entries). Let’s say you’re creating a new user account for Twitter/X and you want to generate a 12-character random password and store it in the password store. To do that,  issue the command:

pass generate SOCIAL/Twitter/USERNAME 12

If you issue the pass command, you’ll see that the new entry has been created. Once again, you can view that password with the command:

pass show SOCIAL/Twitter/USERNAME

Once again, where USERNAME is the Twitter/X username.

Integrating Pass with Git

This is a really cool feature for pass, as it can integrate with Git. To do this, you must first set git global configurations like this:

git config --global user.email "EMAIL"
git config --global user.name "NAME"

Where EMAIL is your email address and NAME is your name. This will initialize a git repository within your pass password store. This git repository can then be cloned onto other machines, using git, and, as long as you keep the repositories in sync, you’ll always have access to your updated passwords.

If you’ve ever needed a command line password manager, pass is what you need. Once you get the hang of how it’s used, you’ll find it to be an outstanding option for those machines that don’t include a GUI but still need the convenience of a password manager.

TRENDING STORIES
Jack Wallen is what happens when a Gen Xer mind-melds with present-day snark. Jack is a seeker of truth and a writer of words with a quantum mechanical pencil and a disjointed beat of sound and soul. Although he resides...
Read more from Jack Wallen
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.