doc/user/ssh_troubleshooting.md
When working with SSH keys, you might encounter the following issues.
In GitLab 16.3 and later, Go limits RSA keys to a maximum of 8192 bits. To check the length of a key:
openssl rsa -in <your-key-file> -text -noout | grep "Key:"
Replace any key longer than 8192 bits with a shorter key.
git cloneWhen you run git clone, you may be prompted for a password, like [email protected]'s password:.
This indicates that something is wrong with your SSH setup.
ssh-agent.ssh -Tv [email protected].
Replace example.com with your GitLab URL.Could not resolve hostname errorYou may receive the following error when you verify your SSH connection:
ssh: Could not resolve hostname gitlab.example.com: nodename nor servname provided, or not known
If you receive this error, restart your terminal and try the command again.
Key enrollment failed: invalid format errorYou may receive the following error when generating an SSH key pair for a FIDO2 hardware security key:
Key enrollment failed: invalid format
You can troubleshoot this by trying the following:
ssh-keygen command using sudo.ssh -V.Permission denied (publickey)The Permission denied (publickey) error usually indicates one or more of the following issues:
~/.ssh/id_rsa or id_ed25519. You might need
to define which key to use.600, and the .ssh directory should use 700.ssh-agent: Verify the key is available to your local SSH client.
This issue is common after a reboot or in new terminal sessions.SSH host keys are not available on this system.If GitLab does not have access to the host SSH keys, when you visit gitlab.example/help/instance_configuration, you see the following error message under the SSH host key fingerprints header instead of the instance SSH fingerprint:
SSH host keys are not available on this system. Please use ssh-keyscan command or contact your GitLab administrator for more information.
To resolve this error:
values.yaml to set sshHostKeys.mount to true under the webservice section./etc/ssh directory for the host keys.If the previous sections don't resolve your issue, run the SSH connection in verbose mode. Verbose mode can return useful information about the connection.
To run SSH in verbose mode, use the following command and replace gitlab.example.com with
your GitLab instance URL:
ssh -Tvvv [email protected]