Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clever SSH to running instances - Troubleshooting section #514

Merged
merged 6 commits into from
Feb 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rephrasing and restructuring
  • Loading branch information
PLhuillery committed Jan 31, 2025
commit c9343941cd64373f79cf707d0bf47025fbc51603
19 changes: 9 additions & 10 deletions content/doc/administrate/ssh-clever-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The `-t` flag is mandatory for the ssh connection to work properly. If your term

## Access your application's folder

No matter wich way you've decided to use to SSH to the machine, your application's folder is located at: `/home/bas/<app_id>`.
No matter which way you've decided to use to SSH to the machine, your application's folder is located at: `/home/bas/<app_id>`.

## Show your application's logs

Expand All @@ -106,25 +106,24 @@ You can also use `journalctl` [with other options](https://www.commandlinux.com/

## Troubleshooting

A commonly encountered issue when inputting `clever ssh <application>` is:
A commonly encountered issue when using `clever ssh` is:
```
Error: Failed to choose instance: 'Error while running choice script: Error: This application has no instances you can ssh to'
Connection to sshgateway-clevercloud-customers.services.clever-cloud.com closed.
```

The most common causes are:
- your application isn't running. You cannot access a non-running instance, your application must be running.
- you do not have the right to access this instance or/and organization.
First, make sure your application is running, otherwise there is no instance to connect to.

For the second cause, it's very likely to be a key management issue. In order to fix it:
If your application is up, this means you aren't allowed to access the organization or application. This might be due to permission issue.
If you're supposed to have access to the application, this is likely due to a key management issue. To fix it:
* make sure you've added your public key on your Clever Cloud profile. You can refer to our documentation to [add your SSH key on Clever Cloud](../../account/ssh-keys-management#add-a-public-ssh-key-on-clever-cloud)
* make sure your client is using the proper private key
* make sure your SSH agent is using the proper private key

A useful command for debugging is:
```
ssh -t [email protected] -v
```

The line `debug1: Will attempt key:` shows you the key(s) used to connect.
This command will show information about your SSH connection attempt, such as the key, and the organization your key is linked to.

If your key is present but not resolved as the first one, you can [force the use of a specific key](../../account/ssh-keys-management/#configure-your-ssh-agent)
If you do not see your SSH key listed, you must [add it to your SSH agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent).
If your key is present but not resolved as the first one in the list, you can [force the use of a specific key](../../account/ssh-keys-management/#configure-your-ssh-agent)