Advertisement
mazursandu

Untitled

May 3rd, 2023
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. To create and add an SSH key to your GitHub account, you can follow these steps:
  2.  
  3. Open your terminal or command prompt and run the command ssh-keygen -t rsa -b 4096 -C "your_email@example.com". This will create a new SSH key pair on your local machine.
  4. When prompted, enter a file name for the key pair (or leave the default name) and enter a passphrase for the private key. Make sure to remember the passphrase, as you will need it later.
  5. Run the command eval "$(ssh-agent -s)" to start the ssh-agent in the background.
  6. Run the command ssh-add ~/.ssh/id_rsa to add your private key to the ssh-agent.
  7. Run the command cat ~/.ssh/id_rsa.pub to display your public key in the terminal.
  8. Copy the entire key that is displayed in the terminal.
  9. In your web browser, navigate to your GitHub account settings.
  10. Click on "SSH and GPG keys" in the left-hand menu.
  11. Click the "New SSH key" button.
  12. Give your key a title (e.g. "My laptop"), paste your public key into the "Key" field, and click "Add SSH key".
  13. Once you have added your SSH key to your GitHub account, you can clone a repository using SSH by running the command git clone git@github.com:username/repo.git, where username is your GitHub username and repo is the name of the repository you want to clone. You can then push changes to the repository using the git push command.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement