If you want to use a password to access the SSH server, a solution for fixing the Permission denied error is to enable password login in the sshd_config file. In the file, find the PasswordAuthentication line and make sure it ends with yes . Find the ChallengeResponseAuthentication option and disable it by adding no .
For people that come here that are just trying to get the repository but don't care about the protocol (ssh / https), you might just want to use https instead of ssh (if it's supported).
So for example you use
git clone https://github.com/%REPOSITORYFOLDER%/%REPOSITORYNAME%.git
instead of
git clone [email protected]:%REPOSITORYFOLDER%/%REPOSITORYNAME%.git
Note that GitHub deprecated password authentication (https login) for private repositories due to it not keeping up with the latest security standards.
Note also that beginning March 1, 2022, Bitbucket users will no longer be able to use their Atlassian account password with git over https, but instead need to use Bitbucket app passwords.
If there is still issue around access after creating SSH and adding it in your Bitbucket account or wherever, you need to do the following in terminal on GitBash, OSX or Linux:
# Lists already added identities (‘ssh keys’)
ssh-add -l
Then, if you don't see your key listed, add it with the following (replace identity
with its real name):
# Add a new identity
ssh-add ~/.ssh/identity
This worked for me.
It looks like a permissions issue - not a Windows 7 issue.
Your ssh key is not authorised - Permission denied (publickey)
.
You need to create a public ssh key and ask the administrator of the Git repository to add the ssh
public key
Information on how to do this: Saving ssh key fails
I faced the same problem with GitHub. Here's how to solve it!
git clone
the project.I've had this issue on a Mac - while I setup SSH correctly to access my Git repository, after restart (and some time the Mac was on a standoff), all my credentials were removed. Apparently, for some reason the pub key was set to 644 which caused it to be removed from the keychain. To readd:
chmod 600
the public keyssh-add ~/.ssh/[your private key]
- this should display that identity has been added. The key file you want is the one without the .pub extension.ssh-add -l
should show you newly added identityedit: apparently MacOS has tendency of removing keys - after downloading the High Sierra update (but I've not installed it yet) my key has been removed and I've had to add it again via ssh-add
For me, when i wanted to clone from my repository, i had the same message noticed before "Permission denied (publickey) fatal: Could not read from remote repository". The solution for my case is to not use sudo before clone That's it.
I also faced the same issue. I did the following and it worked for me:
bitBucket/
git website, and add this key to your profile. This way, the server knows that you are a legitimate user accessing from a legitimate system. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With