2019-06-07 10:33:31 -04:00
---
type: reference, howto
2020-07-17 20:09:34 -04:00
stage: Manage
group: Access
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2019-06-07 10:33:31 -04:00
---
2019-07-16 03:02:20 -04:00
2021-08-23 20:11:18 -04:00
# Restrict allowed SSH key technologies and minimum length **(FREE SELF)**
2017-08-21 06:30:03 -04:00
`ssh-keygen` allows users to create RSA keys with as few as 768 bits, which
falls well below recommendations from certain standards groups (such as the US
2021-06-15 14:09:57 -04:00
NIST). Some organizations deploying GitLab need to enforce minimum key
2017-08-21 06:30:03 -04:00
strength, either to satisfy internal security policy or for regulatory
compliance.
2017-08-28 16:33:35 -04:00
Similarly, certain standards groups recommend using RSA, ECDSA, or ED25519 over
the older DSA, and administrators may need to limit the allowed SSH key
algorithms.
2017-08-21 06:30:03 -04:00
GitLab allows you to restrict the allowed SSH key technology as well as specify
2021-06-15 14:09:57 -04:00
the minimum key length for each technology:
2017-08-21 06:30:03 -04:00
2021-08-26 05:11:15 -04:00
1. On the top bar, select **Menu > Admin** .
2021-06-15 14:09:57 -04:00
1. On the left sidebar, select **Settings > General** (`/admin/application_settings/general`).
1. Expand the **Visibility and access controls** section:
2017-08-21 06:30:03 -04:00
2021-06-15 14:09:57 -04:00
![SSH keys restriction admin settings ](img/ssh_keys_restrictions_settings.png )
2019-02-22 11:55:43 -05:00
2021-06-15 14:09:57 -04:00
If a restriction is imposed on any key type, users cannot upload new SSH keys that don't meet the
requirement. Any existing keys that don't meet it are disabled but not removed and users cannot to
pull or push code using them.
2019-02-22 11:55:43 -05:00
2021-04-25 17:09:26 -04:00
An icon is visible to the user of a restricted key in the SSH keys section of their profile:
2019-02-22 11:55:43 -05:00
![Restricted SSH key icon ](img/ssh_keys_restricted_key_icon.png )
2021-04-25 17:09:26 -04:00
Hovering over this icon tells you why the key is restricted.
2019-06-07 10:33:31 -04:00
2021-08-25 23:09:01 -04:00
## Default settings
By default, the GitLab.com and self-managed settings for the
[supported key types ](../ssh/index.md#supported-ssh-key-types ) are:
- RSA SSH keys are allowed.
- DSA SSH keys are forbidden ([since GitLab 11.0](https://about.gitlab.com/releases/2018/06/22/gitlab-11-0-released/#support-for-dsa-ssh-keys)).
- ECDSA SSH keys are allowed.
- ED25519 SSH keys are allowed.
2019-06-07 10:33:31 -04:00
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X` .
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->