ssh-key-management
Use when adding, listing, or deleting SSH keys for Acquia Cloud access, or when SSH access is denied due to missing keys.
How do I install this agent skill?
npx skills add https://github.com/acquia/acquia-skills --skill ssh-key-managementIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides instructions for managing SSH keys on the Acquia Cloud platform using the vendor's official CLI tool (acli). It covers generating, listing, and deleting keys, as well as configuring Git to use specific SSH identities. All operations are consistent with the skill's purpose and involve standard, legitimate workflows.
- Socketpass
No alerts
- Snykfail
Risk: CRITICAL · 2 issues
What does this agent skill do?
Managing SSH Keys
Use when:
- Adding or generating an SSH key for Acquia Cloud
- Listing or deleting SSH keys
- Setting up SSH access for IDEs or CI/CD pipelines
SSH keys provide secure authentication to Acquia Cloud resources without needing to enter passwords.
Why SSH Keys?
SSH keys allow you to:
- Securely access your IDEs without entering a password
- Push code to your repositories
- Execute remote commands on your servers
- Automate deployments in scripts or CI/CD pipelines
List Your SSH Keys
See all your SSH keys
acli ssh-key:list
Output:
SSH Keys for your account:
[0] My Laptop (generated 2024-01-15)
Fingerprint: ab:cd:ef:12:34:56:78:90
[1] Work Desktop (generated 2024-02-01)
Fingerprint: 11:22:33:44:55:66:77:88
List keys per IDE
acli ide:ssh-key:list
Generate a New SSH Key
Create an SSH key interactively
acli ssh-key:create
This will:
- Prompt for a label (e.g., "My Laptop", "CI Server")
- Generate a public/private key pair
- Store the public key in your Acquia account
- Save the private key locally (usually
~/.ssh/id_rsa)
Example:
$ acli ssh-key:create
? Enter a label for this SSH key: My Laptop
✓ SSH key created!
Public key added to your account.
Private key saved to: ~/.ssh/id_rsa
Fingerprint: ab:cd:ef:12:34:56:78:90
Note: The label prompt is the last step before the key is generated and permanently added to your Acquia account. Confirm your label is correct before pressing Enter.
Upload an Existing SSH Key
If you already have an SSH key, upload it without regenerating:
acli ssh-key:upload --filepath ~/.ssh/id_rsa.pub --label "Existing Key"
Or interactively:
acli ssh-key:upload
Prompts you to select the key file and enter a label.
Key requirements
- RSA only. Cloud Platform rejects ED25519 keys, on trials and other subscriptions, with
The supplied public key type is unsupported.ssh-keygen's modern default is ED25519, so ask for RSA explicitly:ssh-keygen -t rsa -b 4096 -f ~/.ssh/acquia_rsa. An agent without a terminal can't answer the passphrase prompt; add-N ""only after telling the user the key will have no passphrase. - One Acquia account per key. A key registered to another account fails with "Key already in use". Create a separate key.
- Pass
--no-waitwhen no application is linked (a trial, or any directory withoutacli app:link). Without it, acli uploads the key, then tries to wait for it on the linked application and prints "Could not determine Cloud Application" even though the upload worked. Checkacli ssh-key:listbefore retrying; a retry fails on the duplicate label.
Wait for the key to work before cloning
A key with a non-default name (such as ~/.ssh/acquia_rsa) isn't offered by ssh unless you
name it, and an agent's shell has no terminal to accept the git host's key. So name both on every
git command. Put GIT_SSH_COMMAND inline on each command rather than in an export: many agent
shells don't keep exports between commands, and without it ssh falls back to the default keys.
Get the git URL from the environment, not the application (an application has no vcs field): run acli api:applications:list for the application uuid, then acli api:applications:environment-list <uuid> and read vcs.url from the dev environment:
GIT_SSH_COMMAND='ssh -i ~/.ssh/acquia_rsa -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=accept-new' git ls-remote <git url>
A new key can be rejected by the git host for several minutes (~4 observed). Repeat
git ls-remote every ~20 seconds, for up to 8 minutes, until it exits 0, then clone with the
same inline prefix:
GIT_SSH_COMMAND='ssh -i ~/.ssh/acquia_rsa -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=accept-new' git clone <git url> ~/<site_name>
Give the clone a target directory (here ~/<site_name>), so it doesn't land in whatever
directory the shell is in, and run the later steps from there.
In the clone, keep the key for later commands:
git config core.sshCommand "ssh -i ~/.ssh/acquia_rsa -o IdentitiesOnly=yes"
Alternatively, add a Host <git host> entry with IdentityFile ~/.ssh/acquia_rsa to
~/.ssh/config, with the user's OK, since it changes their SSH setup.
Skip waiting for propagation
By default, acli waits for the key to propagate to all servers. Skip this with:
acli ssh-key:upload --filepath ~/.ssh/id_rsa.pub --label "My Key" --no-wait
Create and Upload in One Step
Generate a new key locally and upload it to Cloud Platform in a single command:
acli ssh-key:create-upload
Options:
acli ssh-key:create-upload \
--filename=my_key \
--password="" \
--label="My New Key" \
--no-wait
Inspect an SSH Key
Get details about a specific key by fingerprint:
acli ssh-key:info --fingerprint="ab:cd:ef:12:34:56:78:90"
Useful for confirming which key is registered before deleting.
Delete an SSH Key
Remove a key from your account
acli ssh-key:delete
Prompts which key to delete:
? Select the SSH key to delete: [0] My Laptop
? Delete "My Laptop"? (yes/no)
✓ SSH key deleted.
Non-interactive delete
acli ssh-key:delete --public-key "ab:cd:ef:12:34:56:78:90"
Using SSH Keys with IDEs
SSH into your IDE
Replace the placeholders with your IDE's SSH user and host:
ssh -i ~/.ssh/id_rsa <ide-ssh-user>@<ide-ssh-host>
Set up git over SSH in your IDE
Instead of using HTTPS (which requires password authentication), use SSH:
# Configure your IDE's Git to use SSH
git remote set-url origin git@github.com:yourorg/yourrepo.git
# Now push without entering a password
git push origin main
Export public key for other systems
# Show your public key
cat ~/.ssh/id_rsa.pub
# Copy it to GitLab, GitHub, internal systems, etc.
Best Practices
1. One Key Per Device
Create separate keys for each machine:
# Personal laptop
acli ssh-key:create --label "Personal MacBook"
# Work desktop
acli ssh-key:create --label "Work Desktop"
# CI/CD server
acli ssh-key:create --label "Jenkins CI Server"
2. Use Descriptive Labels
# ✓ Good
acli ssh-key:create --label "2024 MacBook Pro - Home"
acli ssh-key:create --label "GitHub Actions CI"
# ✗ Bad
acli ssh-key:create --label "Key 1"
3. Revoke Old Keys
Remove keys you no longer use:
acli ssh-key:delete
4. Protect Your Private Key
# Permissions should be 600 (read/write for owner only)
chmod 600 ~/.ssh/id_rsa
5. Use SSH Agents
macOS:
# Add to ~/.ssh/config
Host *
AddKeysToAgent yes
UseKeychain yes
Linux:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
Advanced: SSH for CI/CD
Generate key for CI/CD pipeline
acli ssh-key:create --label "GitHub Actions CI"
Then:
- Copy the private key
- Add it to your CI/CD provider's secrets (GitHub Secrets, GitLab CI/CD Variables, etc.)
- Use in your CI script
GitHub Actions example:
- name: Deploy to Acquia
uses: actions/checkout@v2
env:
SSH_KEY: ${{ secrets.ACQUIA_SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
acli api:environments:code-switch <env-id> main
MEO (V3) subscriptions: use
acli api:v3:environments:create-deployment <environmentId> true refs/heads/maininstead ofapi:environments:code-switch(see MEO Deployments).
Related Topics
- IDE Management — Use SSH keys to access IDEs
- Getting Started — Initial setup
- Troubleshooting
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/acquia/acquia-skills/ssh-key-management">View ssh-key-management on skillZs</a>