1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-03-28 21:16:20 +01:00

systemd-creds: add page (#10936)

* systemd-creds: add page

* Update pages/linux/systemd-creds.md

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* Update pages/linux/systemd-creds.md

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* Update pages/linux/systemd-creds.md

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* Update pages/linux/systemd-creds.md

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* Update pages/linux/systemd-creds.md

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

---------

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
This commit is contained in:
Daniel 2023-10-12 22:37:02 +02:00 committed by GitHub
parent d321a03240
commit 3f8e621609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,24 @@
# systemd-creds
> List, show, encrypt and decrypt service credentials.
> More information: <https://www.freedesktop.org/software/systemd/man/systemd-creds.html>.
- Encrypt a file and set a specific name:
`systemd-creds encrypt --name={{name}} {{path/to/input_file}} {{path/to/output}}`
- Decrypt the file again:
`systemd-creds decrypt {{path/to/input_file}} {{path/to/output_file}}`
- Encrypt text from `stdin`:
`echo -n {{text}} | systemd-creds encrypt --name={{name}} - {{path/to/output}}`
- Encrypt the text and append it to the service file (the credentials will be available in `$CREDENTIALS_DIRECTORY`):
`echo -n {{text}} | systemd-creds encrypt --name={{name}} --pretty - - >> {{service}}`
- Create a credential that is only valid until the given timestamp:
`systemd-creds encrypt --not-after="{{timestamp}}" {{path/to/input_file}} {{path/to/output_file}}`