Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To create and add an SSH key to your GitHub account, you can follow these steps:
- 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.
- 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.
- Run the command eval "$(ssh-agent -s)" to start the ssh-agent in the background.
- Run the command ssh-add ~/.ssh/id_rsa to add your private key to the ssh-agent.
- Run the command cat ~/.ssh/id_rsa.pub to display your public key in the terminal.
- Copy the entire key that is displayed in the terminal.
- In your web browser, navigate to your GitHub account settings.
- Click on "SSH and GPG keys" in the left-hand menu.
- Click the "New SSH key" button.
- Give your key a title (e.g. "My laptop"), paste your public key into the "Key" field, and click "Add SSH key".
- 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