sftp icon indicating copy to clipboard operation
sftp copied to clipboard

problems with Permission

Open Marcopolox13 opened this issue 5 years ago • 2 comments

I have problems with Permission

The user name is identical, I ran chown -R 1000:1000 SFTP and chmod -R 777 SFTP and started the docker with UID and GID 1000:1000, but still I can not access the files or create ones. I also tried it with 953:953 and 1000:953 (953 is GID from docker)

Can someone help me?

Marcopolox13 avatar May 27 '20 10:05 Marcopolox13

Have you created a subdirectory for the user, or are you trying to write directly into the user's home directory?

From the README:

The users are chrooted to their home directory, so you can mount the volumes in separate directories inside the user's home directory (/home/user/mounted-directory) or just mount the whole /home directory. Just remember that the users can't create new files directly under their own home directory, so make sure there are at least one subdirectory if you want them to upload files.

Also, you don't need to start the container with the same UID and GID, as long as subdirectories has the same file permissions as the sftp user.

Sharing your commands/configurations and log output also helps

atmoz avatar Jul 13 '20 20:07 atmoz

Same problem here. Running setup Portainer + Docker Package on Synology

Here is my stack

sftp:
    image: atmoz/sftp
    volumes:
        - /volume1/docker/SFTP/data:/home/foo/upload
        - /volume1/docker/SFTP/config/users/users.conf:/etc/sftp/users.conf:ro
    ports:
        - "2222:22"

Connection works fine, but I can create any files/folders in the root or sub-folders.

+----[SHA256]-----+
[/entrypoint] Executing sshd
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
Accepted password for sftp from 172.17.0.1 port 39534 ssh2

I have created another sub-folder (/sftp/) in /volume1/docker/SFTP/data and still same issue

redtripleAAA avatar Feb 28 '21 19:02 redtripleAAA