Ssh Github On Macbook
#devops
- Install
git
brew install git
git --version- Configure Git
git config --global user.name "himanshu864"
git config --global user.email "himanshu864000@gmail.com"- Check for existing SSH Keys
ls -al ~/.sshLook for files named id_rsa and id_rsa.pub. If exists, you already have an SSH key. Hence, skip 4th step.
- Generate new SSH keys
ssh-keygen -t rsa -b 4096 -C "himanshu864000@gmail.com"- Add SSH Key to SSH Agent
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_rsa- Add SSH Key to GitHub Account
# copy public key to clipboard
pbcopy < ~/.ssh/id_rsa.pubAnd paste it to GitHub Browser > Settings > SSH and GPG keys > New SSH Key
- Test SSH Connection
ssh -T git@github.comtype yes and enter to get the following message if successful
Hi himanshu864, You've successfully authenticated, but GitHub does not provide shell access.
- Clone Repositories and Try Pushing changes!