Generate and Setup a new SSH key using Git Bash

Scenario:

Generate and Setup a new SSH key using Git Bash

Solution:

  1. Open Git Bash.
  2. Run below command
  3. $ 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]
  4. Key is created by above step.
  5. Ensure the ssh-agent is running:
    1. eval $(ssh-agent -s)
  6. Add your SSH private key to the ssh-agent.
    1. ssh-add ~/.ssh/id_rsa
  7. Copy the SSH key to your clipboard.
    1. clip < ~/.ssh/id_rsa.pub
  8. 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
  9. Change the remote url to SSH URL.
    1. On command line: git remote set-url origin git@github.com:TestUser/Test-Git-Project.git

No comments:

Post a Comment

Move Github Sub Repository back to main repo

 -- delete .gitmodules git rm --cached MyProject/Core git commit -m 'Remove myproject_core submodule' rm -rf MyProject/Core git remo...