Scenario:
Generate and Setup a new SSH key using Git Bash
Solution:
- Open Git Bash.
- Run below command
- Key is created by above step.
- Ensure the ssh-agent is running:
- eval $(ssh-agent -s)
- Add your SSH private key to the ssh-agent.
- ssh-add ~/.ssh/id_rsa
- Copy the SSH key to your clipboard.
- clip < ~/.ssh/id_rsa.pub
- Go to Git Hub -> Account -> settings -> SSH and GPG keys -> New SSH key or Add SSH key -> Titel: {custom}, key: {paste here} - >Add SSH key
- Change the remote url to SSH URL.
- On command line: git remote set-url origin git@github.com:TestUser/Test-Git-Project.git
$ ssh-keygen -t rsa -b 4096 -C "email@email.com" > Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[enter for default] > Enter passphrase (empty for no passphrase): [Type a passphrase]
No comments:
Post a Comment