Skip to content

Commit dfbe144

Browse files
ereadaxilleas
authored andcommitted
Refactor GitLab basics ssh keys docs
Ensures we give instructions for how to create ssh keys in a single place only.
1 parent 11f1110 commit dfbe144

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

doc/gitlab-basics/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This documentation is split into the following groups:
1515

1616
The following are guides to basic GitLab functionality:
1717

18-
- [Create and add your SSH Keys](create-your-ssh-keys.md), for enabling Git over SSH.
18+
- [Create and add your SSH public key](create-your-ssh-keys.md), for enabling Git over SSH.
1919
- [Create a project](create-project.md), to start using GitLab.
2020
- [Create a group](../user/group/index.md#create-a-new-group), to combine and administer projects together.
2121
- [Create a branch](create-branch.md), to make changes to files stored in a project's repository.
+15-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# How to create your SSH keys
1+
# Create and add your SSH public key
22

3-
This topic describes how to create SSH keys. You do this to use Git over SSH instead of Git over HTTP.
3+
This topic describes how to:
44

5-
## Creating your SSH keys
5+
- Create an SSH key pair to use with GitLab.
6+
- Add the SSH public key to your GitLab account.
67

7-
1. Go to your [command line](start-using-git.md) and follow the [instructions](../ssh/README.md) to generate your SSH key pair.
8-
1. Log in to GitLab.
9-
1. In the upper-right corner, click your avatar and select **Settings**.
10-
1. On the **User Settings** menu, select **SSH keys**.
11-
1. Paste the **public** key generated in the first step in the **Key**
12-
text field.
13-
1. Optionally, give it a descriptive title so that you can recognize it in the
14-
event you add multiple keys.
15-
1. Finally, click the **Add key** button to add it to GitLab. You will be able to see
16-
its fingerprint, title, and creation date.
8+
You do this to use [Git over SSH instead of Git over HTTP](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols).
179

18-
![SSH key single page](img/profile_settings_ssh_keys_single_key.png)
10+
## Creating your SSH key pair
11+
12+
1. Go to your [command line](start-using-git.md).
13+
1. Follow the [instructions](../ssh/README.md#generating-a-new-ssh-key-pair) to generate your SSH key pair.
14+
15+
## Adding your SSH public key to GitLab
16+
17+
To add the SSH public key to GitLab,
18+
see [Adding an SSH key to your GitLab account](../ssh/README.md#adding-an-ssh-key-to-your-gitlab-account).
1919

2020
NOTE: **Note:**
2121
Once you add a key, you cannot edit it. If the paste
22-
didn't work, you need to remove the offending key and re-add it.
22+
[didn't work](../ssh/README.md#testing-that-everything-is-set-up-correctly), you need to remove the key and re-add it.
Binary file not shown.

doc/ssh/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ As an admin, you can restrict
5555
By default, all keys are permitted, which is also the case for
5656
[GitLab.com](../user/gitlab_com/index.md#ssh-host-keys-fingerprints).
5757

58-
## ED25519 SSH keys
58+
### ED25519 SSH keys
5959

6060
Following [best practices](https://linux-audit.com/using-ed25519-openssh-keys-instead-of-dsa-rsa-ecdsa/),
6161
you should always favor [ED25519](https://ed25519.cr.yp.to/) SSH keys, since they
@@ -65,7 +65,7 @@ They were introduced in OpenSSH 6.5, so any modern OS should include the
6565
option to create them. If for any reason your OS or the GitLab instance you
6666
interact with doesn't support this, you can fallback to RSA.
6767

68-
## RSA SSH keys
68+
### RSA SSH keys
6969

7070
RSA keys are the most common ones and therefore the most compatible with
7171
servers that may have an old OpenSSH version. Use them if the GitLab server
@@ -166,12 +166,13 @@ Now, it's time to add the newly created public key to your GitLab account.
166166
NOTE: **Note:**
167167
If you opted to create an RSA key, the name might differ.
168168
169-
1. Add your public SSH key to your GitLab account by clicking your avatar
170-
in the upper right corner and selecting **Settings**. From there on,
171-
navigate to **SSH Keys** and paste your public key in the "Key" section.
172-
If you created the key with a comment, this will appear under "Title".
173-
If not, give your key an identifiable title like _Work Laptop_ or
174-
_Home Workstation_, and click **Add key**.
169+
1. Add your **public** SSH key to your GitLab account by:
170+
1. Clicking your avatar in the upper right corner and selecting **Settings**.
171+
1. Navigating to **SSH Keys** and pasting your **public** key in the **Key** field. If you:
172+
173+
- Created the key with a comment, this will appear in the **Title** field.
174+
- Created the key without a comment, give your key an identifiable title like _Work Laptop_ or _Home Workstation_.
175+
1. Click the **Add key** button.
175176
176177
NOTE: **Note:**
177178
If you manually copied your public SSH key make sure you copied the entire
@@ -305,7 +306,7 @@ who needs to know and configure the private key.
305306
GitLab administrators set up Global Deploy keys in the Admin area under the
306307
section **Deploy Keys**. Ensure keys have a meaningful title as that will be
307308
the primary way for project maintainers and owners to identify the correct Global
308-
Deploy key to add. For instance, if the key gives access to a SaaS CI instance,
309+
Deploy key to add. For instance, if the key gives access to a SaaS CI instance,
309310
use the name of that service in the key name if that is all it is used for.
310311
When creating Global Shared Deploy keys, give some thought to the granularity
311312
of keys - they could be of very narrow usage such as just a specific service or

0 commit comments

Comments
 (0)