Git pull permission denied linux?
The problem is that git is unable to connect to its credential cache (Read http://git-scm.com/docs/git-credential-cache for more information).
From documentation:
The cache is accessible over a Unix domain socket, restricted to the current user by filesystem permissions.
So all you need is to check a file permission for this domain socket. Usually it is placed in ~/.git-credential-cache/socket
and change them to make it accessible by andrewr
user.
Git: How to solve Permission denied (publickey) error when using Git?
If the user has not generated a ssh public/private key pair set before
This info is working on theChaw but can be applied to all other git repositories which support SSH pubkey authentications. (See [gitolite][1], gitlab or github for example.)
First start by setting up your own public/private key pair set. This
can use either DSA or RSA, so basically any key you setup will work.
On most systems you can use ssh-keygen.
- First you'll want to cd into your .ssh directory. Open up the terminal and run:
cd ~/.ssh && ssh-keygen
- Next you need to copy this to your clipboard.
- On OS X run:
cat id_rsa.pub | pbcopy
- On Linux run:
cat id_rsa.pub | xclip
- On Windows (via Cygwin/Git Bash) run:
cat id_rsa.pub | clip
- On Windows (Powershell) run:
Get-Content id_rsa.pub | Set-Clipboard
(Thx to @orion elenzil)- Add your key to your account via the website.
- Finally setup your .gitconfig.
git config --global user.name "bob"
git config --global user.email bob@...
(don't forget to restart your command line to make sure the config is reloaded)That's it you should be good to clone and checkout.
Further information can be found at https://help.github.com/articles/generating-ssh-keys (thanks to @Lee Whitney)
[1]: https://github.com/sitaramc/gitolite
-
If the user has generated a ssh public/private key pair set before
- check which key have been authorized on your github or gitlab account settings
- determine which corresponding private key must be associated from your local computer
eval $(ssh-agent -s)
- define where the keys are located
ssh-add ~/.ssh/id_rsa
git clone ssh permission denied
git clone ssh://github.com/username/repository.git
is wrong. You should be doing:
git clone ssh://git@github.com/username/repository.git
or better yet:
git clone git@github.com:username/repository.git
Git won't add files - 'Permission denied'
You made your files and FOLDERS within 'dir1' have the 644 permissions when you ran that command which is the problem here.
Run this to reset the folder 'dir2' to the correct permissions
chmod 755 dir1/dir2
Manual
Permission denied (publickey) when trying to Git Clone
The key is rejected obviously. Run
ssh-keygen -y -f ~/.ssh/id_rsa
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHFxArGbqkeamciLR8kcsCwFYnagqNe/XG1Ehqhq092mwd/xHq89Pf1kVvC3OBOrvnb4g9l4LMKH28d8ZSJ2cDvtVwolMZBMzNB5HKid+7fNARQngY8t/WE+0ZuQjsA6OelgVx7QYBz893+0gKXdpALxs2Hd69s6Oy+vGphHmxsKG9PHe7l5StJBhMGbBTwDPcO/2YuZE7g5mh3VL/i3EfmkdYLBlBz1FD7/2J8npoYSdiGxUWvrbawfUw8fQwR6byM5AXBHWgJfWyGLKP6etvSQVTdutrp0GBjWn5GFlw8pKsb3R3N6h8CVKHKDAa4Hrf8wduOTwgT22n4zQ677Np
and verify that the string is the same as what you have stored in your github account. From the last update it looks like you stored there output of
ssh-keygen -lf ~/.ssh/id_rsa.pub
2048 SHA256:xh0IVbIJmeYwdFWnvDQp/hB4OK+mjhlPyVXYQVpHTIA jakuje@jakuje-PC219 (RSA)
or
2048 MD5:46:e0:1e:c4:7f:de:12:66:ff:28:e6:36:81:cd:a8:b4 jakuje@jakuje-PC219 (RSA)
which is not the public key, but only its fingerprint (it is not enough). You need to store in your github account whole public key -- content of the file ~/.ssh/id_rsa.pub
.
Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied
It seems like the first one isn't working because your user doesn't have the permissions for changing that directory, and the second because your root user doesn't have the right SSH keys for accessing that git repository.
Depending on what you're trying to do, it might be better to clone the repository to a different directory, or maybe chown
the current directory to have full access for your user
Related Topics
How to Use the Linux Flock Command to Prevent Another Root Process from Deleting a File
How to Reset Emacs to Save Files in Utf-8-Unix Character Encoding
Logcat Show Invisible Messages in Eclipse Mars
Does Linux Time Division Processes or Threads
Where to Get Msbuild for Linux
What Is the Windows Equivalent of Linux Command Wc -L
Linux/Ubuntu Set: Illegal Option -O Pipefail
How to Install Xvfb (X Virtual Framebuffer) on Redhat 6.5
How to Know the Creation Time of a File in Ubuntu
Node.Js Child Processes Being Killed When Parent Dies
How to Write Conditional Import Statements in Qml
How to Download PHP Script from a Web Page with Wget