Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: git over ssh wrong file permissions #1946

Closed
aymanbagabas opened this issue Jun 21, 2021 · 3 comments
Closed

macOS: git over ssh wrong file permissions #1946

aymanbagabas opened this issue Jun 21, 2021 · 3 comments

Comments

@aymanbagabas
Copy link

Summary

Gopass Git is not able to pull/fetch the repository. Git is not able to communicate with the ssh-agent and I keep getting this SSH error every time I try to use a Git related Gopass command. I noticed fixing the permissions fixes the problem. The password store has these permissions, directories 700, files 600, and changing them to 755 and 644 respectively fixes the issue.

› gopass sync
🚥 Syncing with all remotes ...
[<root>]
   git pull and push ... Skipped (no remote)
[<my-remote-private-repository>]
   git pull and push ... ⚠ Failed to pull before git push: exit status 1: unix_listener: path "/var/folders/v3/5pnzpycs0pzdpytmgfzc7tj80000gn/T//.ssh-1e25961f1d73a0c01e9dc5758de11744b777931d.g4fuPOi40otuQpzO" too long for Unix domain socket
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
❌ Failed to push "<my-remote-private-repository>" to its remote: exit status 128: unix_listener: path "/var/folders/v3/5pnzpycs0pzdpytmgfzc7tj80000gn/T//.ssh-1e25961f1d73a0c01e9dc5758de11744b777931d.PigaO4YBexcHychd" too long for Unix domain socket
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
✅ All done

Steps To Reproduce

Running any command that involves Git ex. gopass sync

Expected behavior

Git under Gopass should be able to access the ssh-agent to be able to communicate with the remote repository since I'm using git+ssh

Environment

  • OS: macOS Big Sur
  • OS version: Darwin Aymans-MacBook-Pro.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
  • gopass Version: 1.12.6-git+HEAD go1.16.5 darwin amd64
  • Installation method: go get github.com/gopasspw/gopass

Additional context

@aymanbagabas
Copy link
Author

As suggested in the FAQ, setting TMPDIR didn't help PR #1899. What I ended up doing is using GIT_SSH_COMMAND environment variable and aliasing gopass to

GIT_SSH_COMMAND="ssh -oControlMaster=auto -oControlPersist=600 -oControlPath=/tmp/.ssh-%C" gopass

@AnomalRoil
Copy link
Member

Did you see this: #1896 (comment) ?

Maybe you have some "leftover SSH settings" in your git config?

@aymanbagabas
Copy link
Author

Interestingly, it turned out that the git password store git config had a long ssh command path which was causing the problem. I still don't know how and why that got set in the config. But changing the ssh command control path to /tmp/.ssh-%C in the git config solves the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants