View a markdown version of this page

Installing AWS Credential Daemon - AWS Command Line Interface

Installing AWS Credential Daemon

Developer preview

Built-in support for AWS Credential Daemon in the AWS CLI is a developer preview under active development. Don't use it in production environments. For more information, see Preview scope and limitations.

AWS Credential Daemon (credsd) is a local service that stores your AWS credentials in a protected backend on your computer, instead of in plaintext config and credentials files. The AWS CLI version 2 can then request short-lived credentials from the daemon when it runs a command. This feature is available in the AWS CLI version 2 only.

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

Prerequisites

Before you install AWS Credential Daemon, confirm the following.

  • You installed the developer preview build of the AWS CLI version 2, which includes built-in AWS Credential Daemon support. For steps, see To install the developer preview AWS CLI.

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

  • 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 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

AWS 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)

AWS 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, per-user install (signed release, LaunchAgent)

Your login keychain, available only to the signed credsd app

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 the developer preview AWS CLI

Built-in AWS Credential Daemon support is in a developer preview build of the AWS CLI version 2. It's available from the 2.43.0-credsd-preview release on the GitHub website, for Linux (x86_64 and ARM64) and for macOS on Apple silicon. This is a developer preview build under active development. Don't use it in production environments.

  1. Download and install the build for your platform.

    • On Linux x86_64, run the following commands. They install the preview build in your home folder, alongside any existing AWS CLI version 2 installation. On Linux ARM64, use aws-linux-arm64.zip and awscli-exe-linux-aarch64.zip instead.

      $ curl -fLO https://github.com/aws/aws-cli/releases/download/2.43.0-credsd-preview/aws-linux-x86_64.zip $ unzip aws-linux-x86_64.zip $ unzip awscli-exe-linux-x86_64.zip $ ./aws/install -i ~/aws-cli-preview -b ~/aws-cli-preview/bin $ export PATH=~/aws-cli-preview/bin:$PATH
    • On macOS, run the following commands. The package replaces an existing AWS CLI version 2 installation in the same location.

      $ curl -fLO https://github.com/aws/aws-cli/releases/download/2.43.0-credsd-preview/aws-macos-arm64.zip $ unzip aws-macos-arm64.zip $ sudo installer -pkg AWSCLIV2.pkg -target /
  2. Confirm that the aws on your PATH is the preview build. The version number alone doesn't show this, so check for the credential-daemon commands.

    $ which aws $ aws configure credential-daemon help

    The help lists the install, link, and uninstall commands. If aws reports that credential-daemon is an invalid choice, the aws on your PATH is a build without AWS Credential Daemon support.

To install AWS Credential Daemon with the AWS CLI

(Recommended) The AWS CLI method is the simplest way to install AWS Credential Daemon, and we recommend it for most hosts. Use a manual macOS or Linux procedure for a host with no internet access, an isolated partition, or an AWS CLI without daemon support.

The AWS CLI can download, verify, and install the daemon for you. Installing the daemon doesn't change any of your profiles.

On Linux, the daemon is a system service, so run the command with sudo. It installs the service, then connects the AWS CLI to it for you and for the user who ran sudo. Because sudo resets PATH, give it the full path to the developer preview aws. A plain sudo aws runs the AWS CLI installed for the system, which fails with Found invalid choice 'credential-daemon'.

$ sudo ~/aws-cli-preview/bin/aws configure credential-daemon install

On macOS, run the command without sudo. It installs the daemon for your user only.

$ aws configure credential-daemon install

This command downloads the daemon from GitHub, so it doesn't work in isolated AWS Regions or on networks without internet access. In those environments, copy the signed package to the computer through your approved channel, and install it manually. For instructions, see To install AWS Credential Daemon on macOS or To install AWS Credential Daemon on Linux.

To install AWS Credential Daemon on macOS

On macOS, AWS Credential Daemon installs for your user. The install needs no administrator rights and keeps the encryption key in your login keychain.

  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.

  6. Connect the AWS CLI to the daemon.

    $ aws configure credential-daemon link

To install AWS Credential Daemon on Linux

On Linux, AWS 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
  5. Connect the AWS CLI to the daemon. Each user runs this once, without sudo.

    $ aws configure credential-daemon link

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 AWS Credential Daemon

Before you uninstall the daemon, move profiles that use the daemon back to files. For more information, see Move a profile back to files. Profiles left in the daemon stop working with an error like the following.

The credential daemon isn't running: there's no socket at /home/alice/.aws/credential-daemon.sock. To use the credential daemon, install it with 'aws configure credential-daemon install', link its socket with 'aws configure credential-daemon link', or set AWS_CREDENTIAL_DAEMON_SOCKET.

Uninstall the daemon with one of the following methods.

  • 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
  • To uninstall with the AWS CLI, run the following command. It asks first. The --yes option skips the question, and is required when there is no terminal. On Linux, run it with sudo and the full path to the developer preview aws, as for the install.

    $ sudo ~/aws-cli-preview/bin/aws configure credential-daemon uninstall

    On macOS, run it without sudo.

    $ aws configure credential-daemon uninstall

    On Linux, it removes the system service for every user, root's link, and the ~/.aws/credential-daemon.sock link of the user who ran sudo. Other users remove theirs with aws configure credential-daemon link --remove. On macOS, it removes your per-user install.

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 move the profiles you need back to files.

As long as you can still open your sealed credentials, uninstalling and then reinstalling brings them back. If you can no longer open them, for example after you purge the key, how you recover depends on the kind of credential.

  • For an AWS 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, you need the original, or you must rotate or regenerate it. Examples include an IAM user access key pair and an IAM Roles Anywhere certificate and private key. Keep a copy in escrow if your process requires one.

AWS Credential Daemon doesn't delete the file that you import a secret from. For example, creds bootstrap --credential <name> --private-key <file> copies the private key into secure storage and leaves the original file in place.