Skip to content

Unable to ssh into any environment#

Attempting to ssh into environments fails with Permission denied (publickey) and drush sa returns no aliases.

[example-project]example@cli-drupal:/app$ drush sa
[success] No site aliases found.

This can indicate that there might be an issue with pygmy or your site aliases are not configured. If you have configured your site aliases as per user-site-aliases you can take a look at your pygmy configuration.

First check that the keys you're using are correct.

With Lagoon CLI you can specify the key you would like to use using the -i flag, and check which user the key is attached to with the whoami command

lagoon -i /path/to/private.key whoami

Wth pygmy it should be possible to use a specific key using:

1.ssh-add -D inside the container will remove all keys

2.pygmy addkey /path/of/correct/key outside the container, will add correct key.

3.ssh-add -L inside the container will show you what key are you using

You should see your key as a result

ssh-add -L
ssh-ed25519 example.key.12345 example@example.com

If instead you see Could not open a connection to your authentication agent. or The agent has no identities. it means something is possibly wrong with your keys

  1. pygmy status will tell you the status of pygmy and which ssh-key it's currently using

  2. If you don't see the key in pygmy status run pygmy addkey You should see Successfully added ssh key if the key addition was successful

  3. After that you need to recreate the containers with docker-compose up -d --force

  4. When the containers are recreated, you should be able to see your ssh key with ssh-add -L

If you have further questions, contact support.