linux:security:keyring
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:security:keyring [2020/05/25 15:22] – [Usage] chuck | linux:security:keyring [2021/11/09 14:57] (current) – chuck | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ======Linux Keyring====== | ======Linux Keyring====== | ||
| - | Here's a few tips on using the Linux Keyring. | ||
| - | ---- | ||
| - | |||
| - | =====secret-tool===== | ||
| - | Store and retrieve passwords from the keyring. | ||
| - | |||
| - | ===Install=== | ||
| - | |||
| - | * '' | ||
| - | |||
| - | |||
| - | ===Description=== | ||
| - | <WRAP green announcement smaller> | ||
| - | ==From man secret-tool== | ||
| - | 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. | ||
| - | </ | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ====Usage==== | ||
| - | ===Add an entry=== | ||
| - | < | ||
| - | Password: | ||
| - | </ | ||
| - | |||
| - | ===Get a password=== | ||
| - | < | ||
| - | secret-tool lookup {attribute} {value} {attribute2} {value2} [...] | ||
| - | P4s$W0rd | ||
| - | </ | ||
| - | ===Show entries with simialr key/ | ||
| - | < | ||
| - | secret-tool search --all {attribute} {value} {attribute2} {value2} [...] | ||
| - | [/ | ||
| - | label = test2 | ||
| - | secret = P4s$W0rd | ||
| - | created = 2020-05-08 17:58:08 | ||
| - | modified = 2020-05-08 21:16:04 | ||
| - | schema = (null) | ||
| - | attribute.Path = /test2 | ||
| - | attribute.Uuid = 04706d96b2404a2f96de02a8a76bf113 | ||
| - | attribute.UserName = chuck | ||
| - | attribute.URL = | ||
| - | attribute.Notes = | ||
| - | attribute.Title = test2 | ||
| - | attribute.Key1 = Value1 | ||
| - | attribute.Key2 = Value2 | ||
| - | </ | ||
| - | ===Delete an entry=== | ||
| - | < | ||
| - | secret-tool clear {attribute} {value} {attribute2} {value2} [...] | ||
| - | # Popup from KeePassXC: | ||
| - | Do you really want to move entry " | ||
| - | < | ||
| - | </ | ||
| - | |||
| - | ===Additional search terms=== | ||
| - | Can create values and search them: | ||
| - | < | ||
| - | secret-tool search --all Title name | ||
| - | secret-tool search --all UserName name | ||
| - | secret-tool search --all URL https:// | ||
| - | secret-tool search --all Notes value | ||
| - | secret-tool search --all {attribute} {value} [...] | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===Tips=== | ||
| - | * Set an alias in ~/ | ||
| - | * Use in docker:< | ||
| - | # "The operator can set any environment variable in the container by using one or more -e flags" | ||
| - | docker run -it --rm \ | ||
| - | -e AWS_ACCESS_KEY_ID=$(aws-key-id) \ | ||
| - | -e AWS_SECRET_ACCESS_KEY=$(aws-key-secret) \ | ||
| - | local/ | ||
| - | </ | ||
| - | * From here: https:// | ||
| ---- | ---- | ||
| + | ====Tools==== | ||
| + | * [[linux: | ||
| + | * [[linux: | ||
| - | =====keyring===== | + | ====Keyring Applications==== |
| - | Python-Keyring command-line utility: https:// | + | * [[linux:security:keyring:gnome-keyring]] |
| - | + | * [[linux: | |
| - | ===Install=== | + | |
| - | * '' | + | |
| - | + | ||
| - | ===Description=== | + | |
| - | <WRAP announcement smaller green> | + | |
| - | ==From man keyring== | + | |
| - | **keyring** provides a way to store, lookup and delete passwords in various backends supported by Python-Keyring. | + | |
| - | </ | + | |
| ---- | ---- | ||
| - | ====Usage==== | ||
| - | ===Python=== | ||
| - | You can set/get entries from a Python script or from the Python terminal | ||
| - | ==Add an entry== | ||
| - | < | ||
| - | keyring.set_password(" | ||
| - | |||
| - | # Same as above but ask for the password | ||
| - | keyring.set_password(' | ||
| - | </ | ||
| - | |||
| - | ==Get a password== | ||
| - | < | ||
| - | |||
| - | |||
| - | ===CLI=== | ||
| - | You can set/get entries directly from the command line or from bash scripts, etc. | ||
| - | < | ||
| - | keyring --help | ||
| - | keyring set SERVICE USERNAME | ||
| - | keyring get SERVICE USERNAME | ||
| - | keyring del SERVICE USERNAME | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ====Details==== | ||
| - | The commands above will set the following attributes on an entry: | ||
| - | * For example, running: | ||
| - | * '' | ||
| - | * Will create an entry with the Title: | ||
| - | * Password for ' | ||
| - | * Will set these attributes on the entry: | ||
| - | * **application**: | ||
| - | * **service**: | ||
| - | * **username**: | ||
| - | |||
| - | ==Small Gotcha== | ||
| - | * Note that the attribute username is different than the entry UserName (Note capitalization).< | ||
| - | secret-tool search service twitter | ||
| - | [/ | ||
| - | label = Password for ' | ||
| - | secret = twitterpassword | ||
| - | created = 2020-05-08 22:17:06 | ||
| - | modified = 2020-05-08 22:17:06 | ||
| - | schema = (null) | ||
| - | attribute.Path = /Password for ' | ||
| - | attribute.Uuid = 3174d145b5e74435ab15cf45a5d805cb | ||
| - | attribute.UserName = chuck | ||
| - | attribute.service = twitter | ||
| - | attribute.URL = | ||
| - | attribute.Notes = | ||
| - | attribute.application = Python keyring library | ||
| - | attribute.username = chuckn246 | ||
| - | attribute.Title = Password for ' | ||
| - | </ | ||
| - | |||
| - | ---- | ||
linux/security/keyring.1590420140.txt.gz · Last modified: by chuck
