-
Notifications
You must be signed in to change notification settings - Fork 834
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
remote open("/file"): Permission denied #16
Comments
Each user is jailed in their home directory (for security). That means root is owning the home directory, and the user can not modify it's content. The user can only do changes inside sub-directories. You have to create a directory (i.e. mount a volume) inside the user's home directory, and then you can upload files there. In your case, this will be the "share" directory. |
Here is a way to configure automatically the creation & permissions for a docker-compose.yml
init.sh
|
I'm having the same problem. I find the documentation a bit lacking. Why is this not enough: docker run \
-v /home/SFTP/malnes/share:/home/malnes/share \
-p 2222:22 -d atmoz/sftp \
malnes:randompassword:1001
Logging into the SFTP account, the user is not allowed to put files in either Should the Intuition fails me here. |
This is the nature of file permissions and volumes. They have to match if you want it to work as you expect. I will have a closer look at this challenge soon, and will add more to the documentation, so fewer people fall into this pit. |
Thanks @atmoz, I think that would be great. |
I ran into this also. For me, it was failing to pass in the subdirectory name as an argument to the container COMMAND. In the above examples I see Here's the line which sorted out the permissions issue for me. I'm using a shared volume, so have omitted the group identification mapping. For reference, here's my volume line from the sftp service declaration:
|
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I will allow myself to note that part about permissions is yet to be clarified in main README.md. From perspective of semi-noob as a devops it easy to fail on that front I would suggest modyfing following paragraph of README.md:
Into:
With sentence like that it will save a noob or two out there. ;-) |
I still have the same problem. Can someone help me? |
To anyone who is still experience the problem. Provided that the directory or volume exists.
No additional permissions or scripts required to run (other than ensuring that Docker has got access on Mac etc). so the Docker version of it on cli.
|
I am completely stuck on this issue and I have tried everything in this thread. Docker compose config:
just as @2hoursleep suggested. In my code, I use:
which produces the logs:
However, it's not true!! if I docker exec into the container:
That directory definitely exists I have also tried |
FWIW I was able to get this to work just by making the chown 1001:1001 /host/upload |
For those still having issues: 1- Get UID of user with:
2- Use correct path for home dir when mounting volume + use previous UID:
|
How to resovle this issue under Windows. |
@cthiebault Unfortunately this idea seems to result in
even though bash is available. Update: You have to
|
Can't get this to work. I have mounts like these in
I use the shell environment to set the user, id and group variables:
Which outputs
So it seems to successfully substitute. But then inspecting ownership of the
Why does a user named |
Maybe an issue is that the It's also weird that a use string such as |
None of the above worked for me. Here's what I had to do:
The gist of it is that
Ensuring the UID and GID matched did nothing for me in this case. |
@dMailonG Your code is the only solution among all that works. Thanks! |
None of the above worked for me. But solution for me is /home folder was be auto created docker. if you change chmod application will crash and if users folders wasnt created after start docker, that you need create volumes to per users folder |
it work for me: sftp: file users.conf: |
hey all, Got it working! 🎉 Check out my repo and how-to guide here. Hit me up if you're stuck or just wanna chat about it. Cheers! |
I login correctly to container with the command
sftp -P 2222 user@ip_container
To sftp shell i get this error:
I have run the container with docker-compose:
The text was updated successfully, but these errors were encountered: