I have two user profiles that both need access to one password database. One account’s home directory is private, and I’d rather not loosen permissions or put the file somewhere inappropriate. What’s a sensible setup?
Where should I keep a password database shared by two Linux accounts?
Answers
Create a dedicated shared directory, rather than placing the database in a system directory or changing the permissions on either account’s home. An administrator can create it with sudo, assign it to a group used by the two accounts, and set group access so both can read and write the file. Keep access limited to those accounts and check that newly created files inherit the shared group.
The database itself should still be encrypted, and its key or master password should not be stored alongside it in an accessible plain-text file. Shared access also means both accounts can change or delete the database, so keep a backup.
Reply to this answer
If both profiles belong to one person and are on the same machine, a small group-controlled directory under a suitable shared location is straightforward. Have an administrator set up only that directory and its ownership, rather than making all of /home or a system path writable. Test access from both accounts before moving your only copy of the database.
Also consider whether programs running under the less-trusted profile should be able to read the vault at all. If that profile is meant to be isolated, sharing the database defeats part of that separation.
Reply to this answer
Another option is keeping a separate encrypted copy in each account’s private home and synchronizing changes through a trusted file-sync service or shared storage. That avoids making a local directory accessible to both profiles, but you need to understand how conflicts are handled and avoid editing both copies at once.
For a small number of users, an encrypted password-manager database can work well. If you need centralized access control, auditing, or more users, look at a server-based password manager instead of treating a shared file as a growing team system.
Reply to this answer
Add your answer
Answers are reviewed before publication.
2L!Ravelock:
That sounds like the distinction I was missing. I’m fine using sudo to create a directory, just wary of changing permissions broadly.