When an SSH connection fails with a "Permission denied (publickey)" error, we have identified two common causes:
Using an incorrect key pair
Using another user's
ssh-matlantis.batorssh-matlantis.shfile
These issues often arise from sharing SSH keys or login scripts (ssh-matlantis) with colleagues. Please do not share keys or login scripts. Ensure that you complete a fresh setup by following the instructions in the link below:
https://matlantis.zendesk.com/hc/en-us/articles/40524152374169
1. Incorrect Key Pair
Please verify if your local private key matches the public key registered on Matlantis. You can confirm this by checking the fingerprint of each key. If the fingerprints do not match, the keys are mismatched, and you will need to set up a new key pair.
■ Solution
Identify the correct key pair.
If the correct key cannot be found, please follow the setup instructions to generate a new key pair.
If you wish to verify your keys, follow the steps below:
■ How to check the fingerprint locally
Run the following command: ssh -v matlantis
Search the output for a line starting with: debug1: Will attempt key: <Path to key> <Key type> <Hash format> <Fingerprint>
Confirm the displayed fingerprint.
■ How to check the fingerprint on the remote (Matlantis) server
Run the following command: ssh-keygen -l -f ~/.ssh/authorized_keys
The output will be displayed in the following format: <Bit length> <Fingerprint> <Comment> <Key type>
Confirm the fingerprint from this output.
■ Supplemental Note
When you log in to Matlantis, ~/.ssh/authorized_keys is copied to /run/user/%U/ssh/authorized_keys (where %U is typically 1000), and this copy is used for authentication. Therefore, it is more reliable to check the fingerprint using the file at the latter path.
2. Incorrect ssh_matlantis.bat / ssh_matlantis.sh
The login command (Windows) and shell script (Linux/Mac) contain specific tenant information and user IDs. Using a file shared by a colleague will prevent you from logging in.
■ Solution
Please download your personalized script from the link below and update your local file: https://redirect.matlantis.com/api/me/ssh
Refer to the operation instructions for details on where to place the downloaded file.