Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Permission denied when trying to access from non-root user in container #17

Closed
koenlek opened this issue Mar 6, 2017 · 4 comments
Closed

Comments

@koenlek
Copy link

koenlek commented Mar 6, 2017

Dear @vieux,

I just found out about this great plugin! It really seems to offer exactly what I need. I just ran into a small issue. For reasons I won't explain here, the container that I use has to be run by a non-root user. From that user, I cannot access the mount: if I try to cd or access anything in it, I get an error: bash: cd: <path_name>: Permission denied. When I switch to root (sudo -s), I can cd into it and everything works fine.

Would there be a way in which I can fix this? I would't mind patching the plugin for my own usecase, if you can point me the right direction...

By the way, I tried sudo chown -R <user>:<user> <path_name> and sudo chown <user>:<user> <path_name>, but both don't work...

@koenlek
Copy link
Author

koenlek commented Mar 6, 2017

It turns out that you need to use the -o allow_other option of sshfs. I also figured out more or less how I could add this to the plugin by patching main.go. For now, there is even a quick and dirty fix to get it working using the current version of the plugin:

docker volume create -d vieux/sshfs:latest -o sshcmd="-o allow_other <user>@<host>:<path>" -o password=<pw> <vol_name>

After my clean fix, it would look like this:

docker volume create -d vieux/sshfs:latest -o sshcmd=<user>@<host>:<path> -o allow_other  -o password=<pw> <vol_name>

@chrsch
Copy link

chrsch commented May 28, 2017

@koenlek Great you already provided this PR! This also will fix #15

@vieux
Copy link
Owner

vieux commented Aug 14, 2017

fixed in #18

@vieux vieux closed this as completed Aug 14, 2017
@dodoao
Copy link

dodoao commented Dec 27, 2017

@koenlek !!!! Great you already provided this PR! This also will fix !!!

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

No branches or pull requests

4 participants