summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2016-09-06 23:44:26 +0200
committerAchilleas Pipinellis <axilleas@axilleas.me>2016-09-06 23:44:26 +0200
commit6952a6d76f9421c1238b052b49c8959453bf195c (patch)
treef154db7f0b67a709aea14034bf375a47fd77e386
parent1e042ac251119c5e3b0ef8e76f3a6d9420fba98b (diff)
downloadgitlab-ce-docs/refactor-ssh-keys.tar.gz
First take on refactoring the SSH keys docsdocs/refactor-ssh-keys
- Split ssh/README.md to user/profile/ssh_keys.md and user/project/deploy_keys.md - Deprecate gitlab-basics/create-your-ssh-keys.md and move its info in user/profile/ssh_keys.md - Change links in views
-rw-r--r--app/views/admin/deploy_keys/new.html.haml2
-rw-r--r--app/views/profiles/keys/index.html.haml2
-rw-r--r--app/views/projects/deploy_keys/_form.html.haml2
-rw-r--r--doc/README.md2
-rw-r--r--doc/ci/ssh_keys/README.md14
-rw-r--r--doc/gitlab-basics/README.md2
-rw-r--r--doc/gitlab-basics/basicsimages/add_sshkey.pngbin1394 -> 0 bytes
-rw-r--r--doc/gitlab-basics/basicsimages/key.pngbin1177 -> 0 bytes
-rw-r--r--doc/gitlab-basics/basicsimages/paste_sshkey.pngbin7699 -> 0 bytes
-rw-r--r--doc/gitlab-basics/basicsimages/shh_keys.pngbin4782 -> 0 bytes
-rw-r--r--doc/gitlab-basics/create-your-ssh-keys.md34
-rw-r--r--doc/ssh/README.md134
-rw-r--r--doc/user/profile/ssh_keys.md126
-rw-r--r--doc/user/project/deploy_keys.md23
14 files changed, 166 insertions, 175 deletions
diff --git a/app/views/admin/deploy_keys/new.html.haml b/app/views/admin/deploy_keys/new.html.haml
index 5c410a695bf..ae59840eff1 100644
--- a/app/views/admin/deploy_keys/new.html.haml
+++ b/app/views/admin/deploy_keys/new.html.haml
@@ -14,7 +14,7 @@
.col-sm-10
%p.light
Paste a machine public key here. Read more about how to generate it
- = link_to "here", help_page_path("ssh/README")
+ = link_to "here", help_page_path("user/project/deploy_keys")
= f.text_area :key, class: "form-control thin_area", rows: 5
.form-actions
diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml
index a42b3b8eb38..d046d317b0b 100644
--- a/app/views/profiles/keys/index.html.haml
+++ b/app/views/profiles/keys/index.html.haml
@@ -11,7 +11,7 @@
Add an SSH key
%p.profile-settings-content
Before you can add an SSH key you need to
- = link_to "generate it.", help_page_path("ssh/README")
+ = link_to "generate it.", help_page_path("user/profile/ssh_keys")
= render 'form'
%hr
%h5
diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml
index 901605f7ca3..e2803f5fda8 100644
--- a/app/views/projects/deploy_keys/_form.html.haml
+++ b/app/views/projects/deploy_keys/_form.html.haml
@@ -9,5 +9,5 @@
.form-group
%p.light.append-bottom-0
Paste a machine public key here. Read more about how to generate it
- = link_to "here", help_page_path("ssh/README")
+ = link_to "here", help_page_path("user/project/deploy_keys")
= f.submit "Add key", class: "btn-create btn"
diff --git a/doc/README.md b/doc/README.md
index 254394eb63e..a56f9ba78a0 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -16,7 +16,7 @@
- [Profile Settings](profile/README.md)
- [Project Services](project_services/project_services.md) Integrate a project with external services, such as CI and chat.
- [Public access](public_access/public_access.md) Learn how you can allow public and internal access to projects.
-- [SSH](ssh/README.md) Setup your ssh keys and deploy keys for secure access to your projects.
+- [SSH keys](user/profile/ssh_keys.md) Setup your SSH keys for secure access to your projects.
- [Webhooks](web_hooks/web_hooks.md) Let GitLab notify you when new code has been pushed to your project.
- [Workflow](workflow/README.md) Using GitLab functionality and importing projects from GitHub and SVN.
diff --git a/doc/ci/ssh_keys/README.md b/doc/ci/ssh_keys/README.md
index b858029d25e..21777a1617c 100644
--- a/doc/ci/ssh_keys/README.md
+++ b/doc/ci/ssh_keys/README.md
@@ -29,9 +29,9 @@ This is the universal solution which works with any type of executor
## SSH keys when using the Docker executor
-You will first need to create an SSH key pair. For more information, follow the
-instructions to [generate an SSH key](../../ssh/README.md). Do not add a comment
-to the SSH key, or the `before_script` will prompt for a passphrase.
+You will first need to create an [SSH key][ssh-keys] pair.
+Do not add a comment to the SSH key, or the `before_script` will prompt for a
+passphrase.
Then, create a new **Secret Variable** in your project settings on GitLab
following **Settings > Variables**. As **Key** add the name `SSH_PRIVATE_KEY`
@@ -64,7 +64,7 @@ before_script:
As a final step, add the _public_ key from the one you created earlier to the
services that you want to have an access to from within the build environment.
If you are accessing a private GitLab repository you need to add it as a
-[deploy key](../../ssh/README.md#deploy-keys).
+[deploy key][deploy-keys].
That's it! You can now have access to private servers or repositories in your
build environment.
@@ -80,12 +80,12 @@ on, and use that key for all projects that are run on this machine.
First, you need to login to the server that runs your builds.
Then from the terminal login as the `gitlab-runner` user and generate the SSH
-key pair as described in the [SSH keys documentation](../../ssh/README.md).
+key pair as described in the [SSH keys documentation][ssh-keys].
As a final step, add the _public_ key from the one you created earlier to the
services that you want to have an access to from within the build environment.
If you are accessing a private GitLab repository you need to add it as a
-[deploy key](../../ssh/README.md#deploy-keys).
+[deploy key][deploy-keys].
Once done, try to login to the remote server in order to accept the fingerprint:
@@ -108,3 +108,5 @@ moments the changes will be picked by a public runner and the build will begin.
[ssh-keygen]: http://linux.die.net/man/1/ssh-keygen
[ssh-agent]: http://linux.die.net/man/1/ssh-agent
[ssh-example-repo]: https://gitlab.com/gitlab-examples/ssh-private-key/
+[ssh-keys]: ../../user/profile/ssh_keys.md
+[deploy-keys]: ../../user/project/deploy_keys.md
diff --git a/doc/gitlab-basics/README.md b/doc/gitlab-basics/README.md
index 3aa83975ace..baa59ecef37 100644
--- a/doc/gitlab-basics/README.md
+++ b/doc/gitlab-basics/README.md
@@ -3,7 +3,7 @@
Step-by-step guides on the basics of working with Git and GitLab.
- [Start using Git on the command line](start-using-git.md)
-- [Create and add your SSH Keys](create-your-ssh-keys.md)
+- [Create and add your SSH Keys](../user/profile/ssh_keys.md)
- [Command Line basics](command-line-commands.md)
- [Create a project](create-project.md)
- [Create a group](create-group.md)
diff --git a/doc/gitlab-basics/basicsimages/add_sshkey.png b/doc/gitlab-basics/basicsimages/add_sshkey.png
deleted file mode 100644
index 89c86018629..00000000000
--- a/doc/gitlab-basics/basicsimages/add_sshkey.png
+++ /dev/null
Binary files differ
diff --git a/doc/gitlab-basics/basicsimages/key.png b/doc/gitlab-basics/basicsimages/key.png
deleted file mode 100644
index 04400173ce8..00000000000
--- a/doc/gitlab-basics/basicsimages/key.png
+++ /dev/null
Binary files differ
diff --git a/doc/gitlab-basics/basicsimages/paste_sshkey.png b/doc/gitlab-basics/basicsimages/paste_sshkey.png
deleted file mode 100644
index 578ebee4440..00000000000
--- a/doc/gitlab-basics/basicsimages/paste_sshkey.png
+++ /dev/null
Binary files differ
diff --git a/doc/gitlab-basics/basicsimages/shh_keys.png b/doc/gitlab-basics/basicsimages/shh_keys.png
deleted file mode 100644
index c87f11a9d3d..00000000000
--- a/doc/gitlab-basics/basicsimages/shh_keys.png
+++ /dev/null
Binary files differ
diff --git a/doc/gitlab-basics/create-your-ssh-keys.md b/doc/gitlab-basics/create-your-ssh-keys.md
index f31c353f2cf..4c36fa3f4a8 100644
--- a/doc/gitlab-basics/create-your-ssh-keys.md
+++ b/doc/gitlab-basics/create-your-ssh-keys.md
@@ -1,33 +1 @@
-# How to create your SSH Keys
-
-You need to connect your computer to your GitLab account through SSH Keys. They are unique for every computer that you link your GitLab account with.
-
-## Generate your SSH Key
-
-Create an account on GitLab. Sign up and check your email for your confirmation link.
-
-After you confirm, go to GitLab and sign in to your account.
-
-## Add your SSH Key
-
-On the left side menu, click on "profile settings" and then click on "SSH Keys":
-
-![SSH Keys](basicsimages/shh_keys.png)
-
-Then click on the green button "Add SSH Key":
-
-![Add SSH Key](basicsimages/add_sshkey.png)
-
-There, you should paste the SSH Key that your command line will generate for you. Below you'll find the steps to generate it:
-
-![Paste SSH Key](basicsimages/paste_sshkey.png)
-
-## To generate an SSH Key on your command line
-
-Go to your [command line](start-using-git.md) and follow the [instructions](../ssh/README.md) to generate it.
-
-Copy the SSH Key that your command line created and paste it on the "Key" box on the GitLab page. The title will be added automatically.
-
-![Paste SSH Key](basicsimages/key.png)
-
-Now, you'll be able to use Git over SSH, instead of Git over HTTP.
+This document was moved to [user/profile/ssh_keys](../user/profile/ssh_keys.md).
diff --git a/doc/ssh/README.md b/doc/ssh/README.md
index d6a0979f6ec..7e5fb30769a 100644
--- a/doc/ssh/README.md
+++ b/doc/ssh/README.md
@@ -1,132 +1,4 @@
-# SSH
+This document was split and moved to:
-## SSH keys
-
-An SSH key allows you to establish a secure connection between your
-computer and GitLab. Before generating an SSH key in your shell, check if your system
-already has one by running the following command:
-
-**Windows Command Line:**
-```bash
-type %userprofile%\.ssh\id_rsa.pub
-```
-**GNU/Linux/Mac/PowerShell:**
-```bash
-cat ~/.ssh/id_rsa.pub
-```
-
-If you see a long string starting with `ssh-rsa`, you can skip the `ssh-keygen` step.
-
-To generate a new SSH key, use the following command:
-```bash
-ssh-keygen -t rsa -C "$your_email"
-```
-This command will prompt you for a location and filename to store the key
-pair and for a password. When prompted for the location and filename, just
-press enter to use the default. If you use a different name, the key will not
-be used automatically.
-
-Note: It is a best practice to use a password for an SSH key, but it is not
-required and you can skip creating a password by pressing enter.
-
-If you want to change the password of your key later, you can use the following
-command: `ssh-keygen -p <keyname>`
-
-Use the command below to show your public key:
-
-**Windows Command Line:**
-```bash
-type %userprofile%\.ssh\id_rsa.pub
-```
-**GNU/Linux/Mac/PowerShell:**
-```bash
-cat ~/.ssh/id_rsa.pub
-```
-
-Copy-paste the key to the 'My SSH Keys' section under the 'SSH' tab in your
-user profile. Please copy the complete key starting with `ssh-rsa` and ending
-with your username and host.
-
-To copy your public key to the clipboard, use the code below. Depending on your
-OS you'll need to use a different command:
-
-**Windows Command Line:**
-```bash
-type %userprofile%\.ssh\id_rsa.pub | clip
-```
-
-**Windows PowerShell:**
-```bash
-cat ~/.ssh/id_rsa.pub | clip
-```
-
-**Mac:**
-```bash
-pbcopy < ~/.ssh/id_rsa.pub
-```
-
-**GNU/Linux (requires xclip):**
-```bash
-xclip -sel clip < ~/.ssh/id_rsa.pub
-```
-
-## Deploy keys
-
-Deploy keys allow read-only access to multiple projects with a single SSH
-key.
-
-This is really useful for cloning repositories to your Continuous
-Integration (CI) server. By using deploy keys, you don't have to setup a
-dummy user account.
-
-If you are a project master or owner, you can add a deploy key in the
-project settings under the section 'Deploy Keys'. Press the 'New Deploy
-Key' button and upload a public SSH key. After this, the machine that uses
-the corresponding private key has read-only access to the project.
-
-You can't add the same deploy key twice with the 'New Deploy Key' option.
-If you want to add the same key to another project, please enable it in the
-list that says 'Deploy keys from projects available to you'. All the deploy
-keys of all the projects you have access to are available. This project
-access can happen through being a direct member of the project, or through
-a group. See `def accessible_deploy_keys` in `app/models/user.rb` for more
-information.
-
-Deploy keys can be shared between projects, you just need to add them to each project.
-
-## Applications
-
-### Eclipse
-
-How to add your ssh key to Eclipse: https://wiki.eclipse.org/EGit/User_Guide#Eclipse_SSH_Configuration
-
-## Tip: Non-default OpenSSH key file names or locations
-
-If, for whatever reason, you decide to specify a non-default location and filename for your GitLab SSH key pair, you must configure your SSH client to find your GitLab SSH private key for connections to your GitLab server (perhaps gitlab.com). For OpenSSH clients, this is handled in the `~/.ssh/config` file with a stanza similar to the following:
-
-```
-#
-# Main gitlab.com server
-#
-Host gitlab.com
-RSAAuthentication yes
-IdentityFile ~/my-ssh-key-directory/my-gitlab-private-key-filename
-User mygitlabusername
-```
-
-Another example
-```
-#
-# Our company's internal GitLab server
-#
-Host my-gitlab.company.com
-RSAAuthentication yes
-IdentityFile ~/my-ssh-key-directory/company-com-private-key-filename
-```
-
-Note in the gitlab.com example above a username was specified to override the default chosen by OpenSSH (your local username). This is only required if your local and remote usernames differ.
-
-Due to the wide variety of SSH clients and their very large number of configuration options, further explanation of these topics is beyond the scope of this document.
-
-Public SSH keys need to be unique, as they will bind to your account. Your SSH key is the only identifier you'll
-have when pushing code via SSH. That's why it needs to uniquely map to a single user. \ No newline at end of file
+- [user/profile/ssh_keys](../user/profile/ssh_keys.md)
+- [user/project/deploy_keys](../user/project/deploy_keys.md)
diff --git a/doc/user/profile/ssh_keys.md b/doc/user/profile/ssh_keys.md
new file mode 100644
index 00000000000..c0acee2ba63
--- /dev/null
+++ b/doc/user/profile/ssh_keys.md
@@ -0,0 +1,126 @@
+# SSH keys
+
+An SSH key allows you to establish a secure connection between your
+computer and GitLab.
+
+## How to create your SSH Keys
+
+You need to connect your computer to your GitLab account through SSH Keys. They are unique for every computer that you link your GitLab account with.
+
+To generate a new SSH key, use the following command:
+```bash
+ssh-keygen -t rsa -C "$your_email"
+```
+This command will prompt you for a location and filename to store the key
+pair and for a password. When prompted for the location and filename, just
+press enter to use the default. If you use a different name, the key will not
+be used automatically.
+
+Note: It is a best practice to use a password for an SSH key, but it is not
+required and you can skip creating a password by pressing enter.
+
+If you want to change the password of your key later, you can use the following
+command: `ssh-keygen -p <keyname>`
+
+Use the command below to show your public key:
+
+**Windows Command Line:**
+```bash
+type %userprofile%\.ssh\id_rsa.pub
+```
+**GNU/Linux/Mac/PowerShell:**
+```bash
+cat ~/.ssh/id_rsa.pub
+```
+
+Copy-paste the key to the 'My SSH Keys' section under the 'SSH' tab in your
+user profile. Please copy the complete key starting with `ssh-rsa` and ending
+with your username and host.
+
+To copy your public key to the clipboard, use the code below. Depending on your
+OS you'll need to use a different command:
+
+**Windows Command Line:**
+```bash
+type %userprofile%\.ssh\id_rsa.pub | clip
+```
+
+**Windows PowerShell:**
+```bash
+cat ~/.ssh/id_rsa.pub | clip
+```
+
+**Mac:**
+```bash
+pbcopy < ~/.ssh/id_rsa.pub
+```
+
+**GNU/Linux (requires xclip):**
+```bash
+xclip -sel clip < ~/.ssh/id_rsa.pub
+```
+
+## Add your SSH Key
+
+On the left side menu, click on "profile settings" and then click on "SSH Keys":
+
+![SSH Keys](basicsimages/shh_keys.png)
+
+Then click on the green button "Add SSH Key":
+
+![Add SSH Key](basicsimages/add_sshkey.png)
+
+There, you should paste the SSH Key that your command line will generate for you. Below you'll find the steps to generate it:
+
+![Paste SSH Key](basicsimages/paste_sshkey.png)
+
+Copy the SSH Key that your command line created and paste it on the "Key" box on the GitLab page. The title will be added automatically.
+
+![Paste SSH Key](basicsimages/key.png)
+
+Now, you'll be able to use Git over SSH, instead of Git over HTTP.
+
+## Deploy keys
+
+Deploy keys allow read-only access to multiple projects with a single SSH
+key.
+
+[Read more in the deploy keys documentation.](../project/deploy_keys.md)
+
+## Applications
+
+### Eclipse
+
+How to add your ssh key to Eclipse: https://wiki.eclipse.org/EGit/User_Guide#Eclipse_SSH_Configuration
+
+## Tip: Non-default OpenSSH key file names or locations
+
+If, for whatever reason, you decide to specify a non-default location and filename for your GitLab SSH key pair, you must configure your SSH client to find your GitLab SSH private key for connections to your GitLab server (perhaps gitlab.com). For OpenSSH clients, this is handled in the `~/.ssh/config` file with a stanza similar to the following:
+
+```
+#
+# Main gitlab.com server
+#
+Host gitlab.com
+RSAAuthentication yes
+IdentityFile ~/my-ssh-key-directory/my-gitlab-private-key-filename
+User mygitlabusername
+```
+
+Another example
+```
+#
+# Our company's internal GitLab server
+#
+Host my-gitlab.company.com
+RSAAuthentication yes
+IdentityFile ~/my-ssh-key-directory/company-com-private-key-filename
+```
+
+Note in the gitlab.com example above a username was specified to override the default chosen by OpenSSH (your local username). This is only required if your local and remote usernames differ.
+
+Due to the wide variety of SSH clients and their very large number of configuration options, further explanation of these topics is beyond the scope of this document.
+
+Public SSH keys need to be unique, as they will bind to your account. Your SSH key is the only identifier you'll
+have when pushing code via SSH. That's why it needs to uniquely map to a single user.
+
diff --git a/doc/user/project/deploy_keys.md b/doc/user/project/deploy_keys.md
new file mode 100644
index 00000000000..c9a94389c33
--- /dev/null
+++ b/doc/user/project/deploy_keys.md
@@ -0,0 +1,23 @@
+## Deploy keys
+
+Deploy keys allow read-only access to multiple projects with a single SSH
+key.
+
+This is really useful for cloning repositories to your Continuous
+Integration (CI) server. By using deploy keys, you don't have to setup a
+dummy user account.
+
+If you are a project master or owner, you can add a deploy key in the
+project settings under the section 'Deploy Keys'. Press the 'New Deploy
+Key' button and upload a public SSH key. After this, the machine that uses
+the corresponding private key has read-only access to the project.
+
+You can't add the same deploy key twice with the 'New Deploy Key' option.
+If you want to add the same key to another project, please enable it in the
+list that says 'Deploy keys from projects available to you'. All the deploy
+keys of all the projects you have access to are available. This project
+access can happen through being a direct member of the project, or through
+a group. See `def accessible_deploy_keys` in `app/models/user.rb` for more
+information.
+
+Deploy keys can be shared between projects, you just need to add them to each project.