Reputation: 33
Everyone. I'm so glad to post this question here.
I've been googling so far and I found some answer about this permission issue but they didn't help me. After generating new SSH keys and adding to GitHub my own Account, this problem is being issued continuously. I use Ubuntu 16.04. If you have correct to this question, please let me know. I'll be happy by your any idea, so please recommend any solution.
Thanks for your time. Falcon.Guru
Upvotes: 0
Views: 4644
Reputation: 33
Rohit and gturri. Thanks for your kind answer. I've tried these way to solve this issue But they weren't solution. I just solved this problem. This issue is related to File Permission, not SSH configuration. I pulled it down with this command:
sudo chmod -R 777 YOUR DIRECTORY URL
Thanks Everybody.
Upvotes: 0
Reputation: 1889
Help, I keep getting a 'Permission Denied (publickey)' error when I push!
This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:
*nix
based command
prompt (but not the default Windows Command Prompt!)cd ~/.ssh.
This will take you to the root directory for Git
(Likely C:\Users\[YOUR-USER-NAME]\.ssh\
on Windows).ssh
folder, there should be these two files: id_rsa
and
id_rsa.pub.
These are the files that tell your computer how to
communicate with GitHub, BitBucket, or any other Git based service.
Type ls to see a directory listing. If those two files don't show
up, proceed to the next step. NOTE: Your SSH keys must be named
id_rsa
and id_rsa.pub
in order for Git, GitHub, and BitBucket to
recognize them by default.ssh-keygen -t rsa -C
"[email protected]"
. This will create both id_rsa
and
id_rsa.pub
files.id_rsa.pub
in your favorite text editor (you can do
this via Windows Explorer or the OSX Finder if you like, tpying open
.
will open the folder).id_rsa.pub
and paste it into GitHub and/or BitBucket under
the Account Settings > SSH Keys. NOTE: I like to give the SSH key a
descriptive name, usually with the name of the workstation I'm on
along with the date.Now that you've added your public key to Github and/or BitBucket,
try to git push
again and see if it works. It should!
Upvotes: 1
Reputation: 14629
It might be because you're not using an ssh url. To check this, run
git remote -v
it will print the adresses of your remote repositories. It should look like
origin [email protected]:<user-name>/<project-name>
If it looks like
origin https://github.com/<user-name>/<project-name>
then it's not good. You can fix it with the command
git remote set-url origin [email protected]:<user-name>/<project-name>
Upvotes: 0