secret-tool - Man Page

Store and retrieve passwords

Examples (TL;DR)

Synopsis

secret-tool store [--collection='collection']--label='Label' {attribute} {value} ​.​.​.

secret-tool lookup {attribute} {value} ​.​.​.

secret-tool clear {attribute} {value} ​.​.​.

secret-tool search [--all]{attribute} {value} ​.​.​.

secret-tool lock [--collection='collection']

Description

secret-tool is a command line tool that can be used to store and retrieve passwords​.

Each password is stored in an item​. Items are uniquely identified by a set of attribute keys and values​. When storing a password you must specify unique pairs of attributes names and values, and when looking up a password you provide the same attribute name and value pairs​.

Store

To store a password run secret-tool with the store argument​. You must also specify a label for the password with the --label argument​. This label will be displayed in the password manager​.

Make sure to pass a unique set of attributes names and values when storing a password​. If the attributes match an already existing item, it will be updated instead of creating a new item​.

If invoked from a terminal or tty, then the password to store will be prompted for and only one line will be accepted​.

A password to store can also be piped in via stdin​. The password will be the contents of stdin until EOF​. If you provide a newline via stdin it will be stored as part of the password​.

Passwords are stored in the default collection (usually the "login" collection)​. You can specify a different collection with the --collection argument​.

Lookup

To lookup a password run secret-tool with the lookup argument​. Specify the same same attribute names and value pairs that you passed when storing the password​.

If multiple items match the attribute provided, then the first password that is already unlocked will be returned​. If necessary an item will be unlocked​.

When printing the password to a terminal or tty, an extra newline will be added after the password​.

Clear

To remove a password run secret-tool with the clear argument​. Specify the same attribute name and value pairs that you passed when storing the password​.

All unlocked items that match the attributes will be removed​.

Lock

To lock collections, run secret-tool with the lock argument​. By default, it locks all collections​. If you want to lock a single collection, you can specify it with the --collection argument​.

Exit Status

On success 0 is returned, a non-zero failure code otherwise​.

Examples

Example ​1. ​Storing, retrieving, and clearing a password

$ secret-tool store --label='My password' key1 value1 key2 value2
Password: hunter2
$ secret-tool lookup key1 value1 key2 value2
hunter2
$ secret-tool clear key1 value1 key2 value2

Bugs

The bug tracker can be reached by visiting the website https://gitlab​.gnome​.org/GNOME/libsecret/issues​. Before sending a bug report, please verify that you have the latest version of secret-tool​. Many bugs (major and minor) are fixed at each release, and if yours is out of date, the problem may already have been solved​.

Info

XDG