emberstack / docker-sftp

SFTP Server for Docker
MIT License
196 stars 51 forks source link

Global.Chroot is not respected #152

Open freddyli opened 3 months ago

freddyli commented 3 months ago

I would like to change the default Global.Chroot to something else, like: %h/sftp. No other Chroot configuration in Users. Still, the users get configured with the default Chroot of %h.

I think I have some hints to the root cause below.

My config is:

{
    "Global": {
        "Chroot": {
            "Directory": "%h/sftp"
        }
    },
    "Users": [
        {
            "Username": "demo",
            "Password": "demo",
        }
    ]
}

I wse docker compose:

  sftp:
    image: "emberstack/sftp:5.1.71"
    ports:
      - "22:22"
    volumes:
      - ./secrets/sftp.json:/app/config/sftp.json:ro
      - ./volumes/demo/something/:/home/demo/sftp/something/

Maybe I am overlooking something and barking up the wrong tree. But after a quick look through the code, here are my thoughts in screenshots:

240809-145311 240809-145331 240809-145249 240809-145410 240809-145458

freddyli commented 3 months ago

A workaround is to specify Chroot for each user explicitly.

image