View a markdown version of this page

Installing Amazon Credential Daemon - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Installing Amazon Credential Daemon

Amazon Credential Daemon (credsd) is a local service that stores your Amazon credentials in a protected backend on your computer, instead of in plaintext config and credentials files. The Amazon CLI, the Amazon SDKs, and tools built on them get short-lived credentials from the daemon through a credential_process profile, with any Amazon CLI or SDK version.

With the daemon, your credentials stay out of plaintext files while your commands and programs keep working as before. For the client commands, non-Amazon CLI credential sources, and conceptual information, see Using Amazon Credential Daemon in the IAM User Guide and the Amazon Credential Daemon documentation on GitHub.

After you install Amazon Credential Daemon, configure a profile so that the Amazon CLI and Amazon SDKs get credentials from the daemon. For more information, see Using Amazon Credential Daemon with the Amazon CLI and Amazon SDKs.

Prerequisites

Before you install Amazon Credential Daemon, confirm the following.

  • On Linux, you have root access (sudo). On macOS, you don't need root access.

  • To verify the signature of a downloaded package, you installed GnuPG (gpg). This step is optional but recommended.

  • On Linux with a Trusted Platform Module (TPM), you installed the tpm2-tss package. On Amazon Linux 2023, use the following command.

    $ sudo dnf install -y tpm2-tss

    On Ubuntu, use the following command.

    $ sudo apt-get install -y libtss2-dev

    On Amazon EC2, the instance must have NitroTPM enabled. Use a UEFI boot-mode AMI that is registered with TPM 2.0 support (--boot-mode uefi --tpm-support v2.0).

Platform availability

Amazon Credential Daemon is available for macOS and Linux today. Windows availability is planned for Q1 2027. The following table lists the available platforms and their packages.

Platform

Package

Notes

macOS 11 or later, Apple silicon

credsd-macos-aarch64.pkg (signed and notarized)

Amazon Credential Daemon isn't available for Intel-based Macs.

Linux, x86_64 and arm64

credsd-linux-x64.tar.gz, credsd-linux-aarch64.tar.gz, and the -tpm version of each

Portable builds for glibc 2.17 or later, including Amazon Linux 2, Amazon Linux 2023, and Ubuntu. Use a -tpm archive on hosts with a TPM 2.0.

Windows

Not yet available

Planned for Q1 2027.

The daemon stores its encryption key in a storage backend that depends on how and where you install it. The following table shows the backend that each install shape uses.

Backend

Install shape

Where the key is kept

data-protection-keychain

macOS (signed release, LaunchAgent)

A data protection keychain item that only the signed credsd app can open

tpm

Linux (systemd)

The computer's TPM 2.0

file

Linux without a TPM

A file on disk, readable by the daemon's account. This backend isn't hardware-protected.

The file backend isn't hardware-protected

On a host without a TPM, the only backend is file, which keeps the encryption key in a file instead of in hardware. Use this backend only if you accept that anyone who can read the daemon's files can decrypt your credentials.

To install Amazon Credential Daemon on macOS

The signed package installs Amazon Credential Daemon for your user. It needs no administrator rights, and keeps the encryption key in a data protection keychain item that only the signed credsd app can open.

  1. Download the package and its signature.

    $ base=https://github.com/aws/credential-daemon/releases/latest/download $ curl -fLO "$base/credsd-macos-aarch64.pkg" $ curl -fLO "$base/credsd-macos-aarch64.pkg.sig"
  2. (Optional, recommended) Verify the signature. Import the signing key, check the fingerprint, and verify the package.

    $ curl -fsSL https://raw.githubusercontent.com/aws/credential-daemon/main/KEYS | gpg --import $ gpg --fingerprint aws-credential-daemon@amazon.com $ gpg --verify credsd-macos-aarch64.pkg.sig credsd-macos-aarch64.pkg

    Confirm that the fingerprint is 91AA 53FE 815B 7D0D C20D 1467 189A 6EBA E4B4 D2A4 and that gpg reports a good signature.

  3. Install the package for your user. No administrator rights are needed.

    $ installer -pkg credsd-macos-aarch64.pkg -target CurrentUserHomeDirectory
  4. Open a new terminal window so that ~/.local/bin is on your PATH.

  5. Confirm that the daemon is running.

    $ credsd status

    The output shows installed: true, running: true, and the data-protection-keychain backend.

To install Amazon Credential Daemon on Linux

On Linux, Amazon Credential Daemon runs as a system service that systemd starts on the first request.

  1. Download the archive for your distribution and architecture, and its signature. Choose the -tpm archive if the host has a TPM 2.0 (the device /dev/tpmrm0 exists).

    $ base=https://github.com/aws/credential-daemon/releases/latest/download $ f=credsd-linux-x64-tpm.tar.gz $ curl -fLO "$base/$f" && curl -fLO "$base/$f.sig"
  2. (Optional, recommended) Verify the signature as in the macOS procedure, using the .tar.gz and .tar.gz.sig files.

  3. Extract the archive and install the commands.

    $ tar xzf "$f" $ sudo install -m 0755 "${f%.tar.gz}/credsd" "${f%.tar.gz}/creds" /usr/local/bin/
  4. Install the system service, and then confirm that it is running.

    $ sudo credsd install --storage-backend tpm $ credsd status installed: true running: true binary: /usr/local/bin/credsd args: --storage-backend tpm serve --system backend: tpm data dir: /var/lib/credsd socket: /run/credsd/credsd.sock

    On a host without a TPM, use the plain archive (credsd-linux-x64.tar.gz or credsd-linux-aarch64.tar.gz), and install with the file backend instead. You must name it explicitly; see the warning in Platform availability.

    $ sudo credsd install --storage-backend file

The service is socket-activated (credsd.socket and credsd.service): systemd starts the daemon on the first request. The daemon reads the TPM through /dev/tpmrm0, which must be owned by root:tss with mode 0660. If creds list hangs right after you install tpm2-tss, see Troubleshooting.

To uninstall Amazon Credential Daemon

Before you uninstall the daemon, remove the credential_process line from any profile that uses Amazon Credential Daemon, and restore whatever credentials that profile used before. For more information, see Using Amazon Credential Daemon with the Amazon CLI and Amazon SDKs.

Uninstall the daemon with one of the following methods.

  • For a per-user install on macOS, run the following command. Then move ~/Applications/Credsd.app to the Trash, and remove ~/.local/bin/credsd and ~/.local/bin/creds.

    $ credsd uninstall --user
  • On Linux, run the following command.

    $ sudo credsd uninstall

Uninstalling removes the service but keeps your sealed credentials and the encryption key, so reinstalling brings them back. To also delete the key when you uninstall, add the --purge-key option.

$ sudo credsd uninstall --purge-key
Purging the key is permanent

The --purge-key option deletes the encryption key. Every credential sealed under that key becomes permanently unreadable, and you can't recover it. First remove the credential_process line from each profile that uses Amazon Credential Daemon, and restore that profile's previous credentials.

If you can no longer open the sealed credentials, what you do next depends on the kind of credential.

  • For an Amazon Sign-In session or an IAM Identity Center session, sign in again. There is no provisioned secret to recover.

  • For a provisioned long-term credential, such as an IAM user access key pair or an IAM Roles Anywhere certificate and private key, you need the original, or you must rotate or regenerate it. Keep a copy in escrow if your process requires one.

Amazon Credential Daemon does not delete the file you imported a secret from. For example, creds bootstrap --credential name --private-key file copies the private key into secure storage and leaves the original file where it is.