Hi everyone,
Just wanted to ask how to handle the following situation:
- shared computer, everyone has an unprivileged, non-sudoer account and logs in via ssh for example or JupyterHub (unprivileged terminal, no
sudo
possible from there). - shared directory (everyone in same group, all files owned by group, sticky bit, file owner varies)
- git-annex repository on this shared directory
Problem: git-annex operations fail depending on who the owner of the files is. As git-annex needs to chmod
files (which is only possible as owner of the file), this is a problem.
A partial solution I've employed right now is to sudo-allow one specific command that recursively sets themselves as owner for the shared directory (including the git-annex repo). This however only works when sudo
is working, which is not the case from JupyterHub...
Any other ideas? (Except ditching the shared folder...)
Cheers,
Yann
Git has an option to initialize repos in a shared mode (
git init --shared=group
); then it sets all relevant files not only to group writable, but also sets sticky bits so that the group is preserved.This does also work with git-annex. (It doesn't work so well when users rsync-copy data to that shared repository, but a) that may have been fixed since I stopped letting multiple users do it, and b) it probably doesn't apply to your use case).
git init --shared
seems to work so far, thanks! Still wondering why though. git annex also seems to not remove the write bit anymore, or at least only for 'everyone', soo-w
or something. 🤷git-annex repository version 10 improves that, it is able to remove the write bit in a shared repository.
git-annex upgrade
can upgrade your repo, if you have git-annex version 10.