반응형
git@github.com: Permission denied (publickey) - Stack Overflow
1. Check SSH Key:
- Check Existing SSH Keys: Ensure that you have an existing SSH key. Run the following command to list your existing keys:Look for files named id_rsa or id_rsa.pub.
- ls -al ~/.ssh
- Generate a New SSH Key (If Needed): If you don't have an SSH key or want to generate a new one, you can use the following command:Follow the prompts to generate a new key. Make sure to replace "your_email@example.com" with your actual email address.
- ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
- Add SSH Key to SSH Agent: Start the SSH agent and add your private key:
- eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa
2. Add SSH Key to GitHub:
- Copy the SSH Key to Clipboard: Use the following command to copy your SSH key to the clipboard:If the clip command is not available, you can open the id_rsa.pub file with a text editor and manually copy its contents.
- clip < ~/.ssh/id_rsa.pub
- Add SSH Key to GitHub:
- Go to your GitHub account settings.
- Navigate to "SSH and GPG keys" or "SSH keys."
- Click on "New SSH key" or "Add SSH key."
- Paste your key into the provided field and give it a title.
오랜만에, github 추가하려다가 push가 잘 안되어서 찾아보다가 발견한 해결책
반응형