Skip to content

Commit

Permalink
Document how to use GH in the ring with 2FA.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Jul 5, 2019
1 parent a80a239 commit 50e09be
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions source/components/github.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
***********************
Using GitHub at NSLS-II
***********************

Two-factor authentication
-------------------------

We strongly recommend `securing your account with two-factor authentication <https://help.github.com/en/articles/securing-your-account-with-two-factor-authentication-2fa>`_.

For normal use from the campus network, the most convenient way to access
GitHub is using SSH. See `GitHub's SSH guide <https://help.github.com/en/articles/connecting-to-github-with-ssh>`_.
Your remotes will look like:

.. code-block:: bash
$ git remote -v
danielballan [email protected]:danielballan/bluesky (fetch)
danielballan [email protected]:danielballan/bluesky (push)
origin [email protected]:bluesky/bluesky (fetch)
origin [email protected]:bluesky/bluesky (push)
Note ``[email protected]:`` in place of where you might have
``https://github.com/``. You can update a remote using

.. code-block:: bash
$ git remote set-url <NAME> <NEW_URL>
For use inside the ring, connecting via SSH does not work. (Consult ITC to ask
why.) Your best option is to a personal access token, which you can do at
`github.com/settings/tokens <https://github.com/settings/tokens>`_ or by
following `GitHub's token guide <https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line>`_.
You can then paste the token into a file in your home directory. Make sure
to restrict the permissions with ``chmod 600 path/to/file_with_token`` or any
user will be able to read it and log into GitHub as you!

To *use* the token, set the remote urls in the HTTPS style
(not ``[email protected]:``). When you try to push you will be prompted to enter
your username. Paste the token it instead. GitHub will recognize your username
automatically from the token.
1 change: 1 addition & 0 deletions source/deployment_docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Components

.. toctree::

components/github
components/conda
components/ansible-setup

Expand Down

0 comments on commit 50e09be

Please sign in to comment.