-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document how to use GH in the ring with 2FA.
- Loading branch information
1 parent
a80a239
commit 50e09be
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ Components | |
|
||
.. toctree:: | ||
|
||
components/github | ||
components/conda | ||
components/ansible-setup | ||
|
||
|