Giter Site home page Giter Site logo

Comments (10)

atmoz avatar atmoz commented on May 13, 2024 2

You have to give the sftp user UID and GID that match file and directory permissions on your mounted volumes.

Say your mounted volume is a directory owned by a user with UID 1000. Then you must set UID to 1000, if you want write permission.

from sftp.

hemanthactionfi avatar hemanthactionfi commented on May 13, 2024 2

command: foo:pass:::upload
i tried this in docker-compose and it is working without any permission erros.

from sftp.

jsatk avatar jsatk commented on May 13, 2024

@atmoz Thanks for the response.

I think I understand but I'm still getting the same permission denied error.

In my docker-compose.yml i have this:

sftp:
  image: atmoz/sftp
  volumes:
    - "./test/sftp/mock_server:/home/jesse/share"
  ports:
    - "2222:22"
  command: jesse:jesse:502

And locally when I view who owns the directory mock_server it's my user and when I run id -u I see that my user's UID is 502.

Can you elaborate or provide any clarification?

Thanks in advance.

from sftp.

atmoz avatar atmoz commented on May 13, 2024

What operation are you trying to do? Are you doing it in the "share" directory? What are the permissions on ./test/sftp/mock_server?

Try exec-ing into the container (docker exec -it <container-id> bash) and create a test-folder and chown it to 502. Can your jesse user change it's content?

from sftp.

jsatk avatar jsatk commented on May 13, 2024

@atmoz thanks for the reply. I was able to resolve my issue via the last line of your previous message. Rather than attempting to set the sftp user to the same UID as my local user who owned the share folder, I ssh-ed into the sftp docker container and viewed the info for the folder which was owned by a user with a UID of 1000. So then in the docker-compose.yml I set my user's UID to 1000 and all worked well. I was able to write and delete files as well as read them.

Thanks for the help.

from sftp.

mateodelnorte avatar mateodelnorte commented on May 13, 2024

Is there a way to do this programmatically? I want to deploy my sftp server to a docker swarm. I'd like it if I can just 1) create a key pair for a user 2) create a couple lines in a stack.yml file for the same user and deploy my code and be done. Ideally, I want to have the folders the users' files end up on be a shared aws EFS volume that other services can also mount.

Is there a way to determine UID at dev time, such that I don't have to inspect the folder structure in the container?

Thanks.

from sftp.

slhck avatar slhck commented on May 13, 2024

This is only slightly related, but after changing the user ID in the config, it's important that one runs:

docker-compose stop
docker-compose up -d

If you do docker-compose restart, it will not update the config, but instead use the existing container. See the docs for more info.

from sftp.

davidwneary avatar davidwneary commented on May 13, 2024

Is there a way to determine UID at dev time, such that I don't have to inspect the folder structure in the container?

I'd also be interested if anyone has an answer to this

from sftp.

mateodelnorte avatar mateodelnorte commented on May 13, 2024

I ended up just mounting my users.conf file as a docker volume. So, I just edit the file at dev time when I want to add a new user.

from sftp.

javawithrocky avatar javawithrocky commented on May 13, 2024

@atmoz thanks for the reply. I was able to resolve my issue via the last line of your previous message. Rather than attempting to set the sftp user to the same UID as my local user who owned the share folder, I ssh-ed into the sftp docker container and viewed the info for the folder which was owned by a user with a UID of 1000. So then in the docker-compose.yml I set my user's UID to 1000 and all worked well. I was able to write and delete files as well as read them.

Thanks for the help.

Can you share your docker-compose.yaml file?

from sftp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.