![]() ![]() On the left sidebar, click on SSH and GPG keys.On GitHub, click on your avatar, then select Settings.$ cat ~/.ssh/id_ed25519.pubĬopy its contents. Open the contents of the ~/.ssh/id_ed25519.pub file in your home folder. This is the public key generated earlier in this tutorial that you will share with your GitHub account. In ~\.ssh you should see a file ending with. But before you do, you will need to copy the SSH public key generated on the previous step to your clipboard. Now that you’ve completed the step on your computer, you will will switch to your GitHub account. SHA256:AuErG 8I8YUkRbNn1iNiGB/T3P6p4oWtmHA821i3bPO key's randomart image is: Your public key has been saved in /home/jdcolby/.ssh/id_ed25519.pub You will then see an output similar to this: Your identification has been saved in /home/jdcolby/.ssh/id_ed25519 This passphrase will be used instead of your password when performing a Git/GitHub transaction from your computer, so don’t forget it! > Enter passphrase (empty for no passphrase): Accept the default file location and press the Enter key.Īt the prompt, type a secure passphrase. This creates a new SSH key, using the provided email as a label. For example, jdcolby would type the following: $ ssh-keygen -t ed25519 -C Generating public/private ed25519 key pair.Įnter file in which to save the key (/home/jdcolby/.ssh/id_ed25519): In your Bash shell, type the following (note that the email address should be the one tied to your GitHub account). This step is OS specific and is highlighted in the next subsections. It might therefore be best to cache your token. Pasting your token each time you push or pull from your repo may prove cumbersome after a while. Do not attempt a re-paste since this will only add the token to the end of the already pasted token. This might lead you to believe that it did not paste. When you paste your token, you will not see it displayed on the command line. For example, if you are cloning a private repo that your account has access to, you would enter the above token instead of your GitHub password. Once you’ve created your token on GitHub, you simply substitute your GitHub password with your access token. Note that you will not be able to access the token string once you exit the window! You might want to keep this window open until you’ve completed the steps outlined next. It might be a good idea to temporarily paste the token into a plain text editor. When copying the token id, be careful not to add any empty spaces to the beginning or end of the token. This will allow you to read/write to your repo.Ĭlick Generate token at the bottom of the page.Ĭopy and temporarily save the token before closing the window. In this example, we’ll set it for 90 days.įrom the scopes menu, select repo. In the next field, you can set an expiration date for this token, or make it permanent. In the Note field, assign a name to this token such as the local computer you are creating this token for. In the left sidebar, click Personal access tokens.Ĭlick Generate new token (button near the upper left-hand side). On the left sidebar, click on Developer settings (this should be near the bottom of the left sidebar. Personal access token (PAT) based authenticationįirst, you need to follow these steps on GitHub:Ĭlick on your avatar (upper right-hand corner) and select Settings. If jdcolby clones that same repo1 repository from her GitHub account using SSH, she would type: $ git clone on setting up authentication using both techniques follow. If you use an SSH key, you will connect to your GitHub repo over SSH.įor example, if jdcolby clones repo1 from her GitHub account using HTTPS, she would type: $ git clone If you use PAT, you will connect to your repo over HTTPS–this is the connection used in this workshop. Note that your choice of authentication will be dictated by the way you connect to your GitHub repo. Both techniques require some degree of configuration on both your GitHub account and your local machine, but the PAT will be the easiest to set up for your students. Two of these options are covered here: Personal Access Token ( PAT) or SSH-based authentication. Instead, you need to adopt one of several authentication options. ![]() Using your GitHub password is no longer allowed after August 13, 2021. For example, when pushing changes made in a local repo to GitHub, the session would look something like this: $ git push ![]() Prior to August 13, 2021, you were allowed to authenticate by typing a username and password every time you pushed or pulled from GitHub. Avoiding the need to enter a passphrase.Converting an existing HTTPS local repo to SSH.Adding the SSH key to the ssh-agent process. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |