From: Milin Date: Thu, 8 Aug 2019 22:12:37 +0000 (-0500) Subject: Add SSH Guide on how to generate SSH keys X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F16495%2F4;p=releng%2Fdocs.git Add SSH Guide on how to generate SSH keys Add "How to generate SSH Keys" guide to LF docs for anonymous users. Issue: RELENG-562 Signed-off-by: Milin Change-Id: I52bc7d35727138f5300f7d7e696c3bad17b8c2e0 --- diff --git a/docs/_static/ssh-keygen_1.png b/docs/_static/ssh-keygen_1.png new file mode 100755 index 0000000..0ea6d23 Binary files /dev/null and b/docs/_static/ssh-keygen_1.png differ diff --git a/docs/_static/ssh-keygen_2.png b/docs/_static/ssh-keygen_2.png new file mode 100755 index 0000000..5a50961 Binary files /dev/null and b/docs/_static/ssh-keygen_2.png differ diff --git a/docs/_static/ssh-keygen_3.png b/docs/_static/ssh-keygen_3.png new file mode 100755 index 0000000..c75813e Binary files /dev/null and b/docs/_static/ssh-keygen_3.png differ diff --git a/docs/_static/ssh-keygen_4.png b/docs/_static/ssh-keygen_4.png new file mode 100755 index 0000000..7b32841 Binary files /dev/null and b/docs/_static/ssh-keygen_4.png differ diff --git a/docs/index.rst b/docs/index.rst index 31a946c..974bccd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,6 +24,7 @@ Guides: nexus2 nexus3 meetbot + ssh .. TODO Release Workflow (RELENG-511) .. TODO Javadoc (RELENG-515) diff --git a/docs/ssh.rst b/docs/ssh.rst new file mode 100644 index 0000000..971000d --- /dev/null +++ b/docs/ssh.rst @@ -0,0 +1,136 @@ +.. _lfreleng-docs-ssh: + +######### +SSH Guide +######### + + +Ssh-keygen is a tool for creating new authentication key pairs for SSH, which is then used for automating logins, single sign-on, and for authenticating hosts. + +Creating a SSH key on Windows +----------------------------- + +#. Check for existing SSH keys + +You can use an existing key if you'd like, but creating a new key per service is a good security practice. + + Open a command prompt, and run: + + .. code-block:: bash + + cd %userprofile%/.ssh + + If you see "No such file or directory", then there aren't any existing keys and you'll need to create a new one. Go to `Generate a new SSh key`._ + + Check to see if you have a key already: + + .. code-block:: bash + + dir id_* + + If there are existing keys, you may want to use those. + +#. Back up old SSH keys + +If you have existing SSH keys, but you don't want to use them when connecting to remote Server, you should back those up. + + In a command prompt on your local computer, run: + + .. code-block:: bash + + mkdir key_backup + copy id_rsa* key_backup + +#. Generate a new SSH key + +If you don't have an existing SSH key that you wish to use, generate one as follows: + + #. Log in to your local computer as your user. + #. In a command prompt, run: + + .. code-block:: bash + + ssh-keygen -t rsa -b 4096 -C "your_email@example.com" + + Associating the key with your email address helps you to identify the key later on. + + Note that the ssh-keygen command is present and available if you have already installed Git (with Git Bash). + + You'll see a response like this: + + .. image:: _static/ssh-keygen_1.png + :alt: ssh-keygen_1. + :align: center + +#. Enter, and re-enter, a passphrase when prompted. The whole interaction will look like this: + + .. image:: _static/ssh-keygen_2.png + :alt: ssh-keygen_2. + :align: center + +#. You're done! + + +Creating an SSH key on Linux & macOS +------------------------------------ + +#. Check for existing SSH keys + +You can use an existing key if you'd like, but creating a new key per service is a good security practice. + + + Open a terminal and run the following: + + .. code-block:: bash + + cd ~/.ssh + + If you see "No such file or directory", then there aren't any existing keys and you'll need to create a new one. Go to `Generate a new SSH key`._ you can also refer to https://help.github.com/en/enterprise/2.16/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent. + + Check to see if you have a key already: + + .. code-block:: bash + + ls id_* + + If there are existing keys, you may want to use those. + +#. Back up old SSH keys + +If you have existing SSH keys, but you don't want to use them when connecting to Bitbucket Server, you should back those up. + + Do this in a terminal on your local computer, by running: + + .. code-block:: bash + + mkdir key_backup + mv id_rsa* key_backup + +#. Generate a new SSH key + +If you don't have an existing SSH key that you wish to use, generate one as follows: + + #. Open a terminal on your local computer and enter the following: + + .. code-block:: bash + + ssh-keygen -t rsa -b 4096 -C "your_email@example.com" + + Associating the key with your email address helps you to identify the key later on. + + You'll see a response like this: + + .. image:: _static/ssh-keygen_3.png + :alt: ssh-keygen_3. + :align: center + +#. Press to accept the default location and file name. If the .ssh directory doesn't exist, the system creates one for you. + +#. Enter, and re-enter, a passphrase when prompted. + The whole interaction will look like this: + + .. image:: _static/ssh-keygen_4.png + :alt: ssh-keygen_4. + :align: center + +#. You're done!