I currently have a atmoz/sftp docker container setup with one user. I can create/move/delete files but when I try to rename a file I get error code 3 permission denied. This is using winscp and the folder permission mask is 777. so the file I create has permissions 777 when I try to rename it and is owned by user.

File structure: /home root:744 /user root:744 /home user:777 /subdirectory user:777 ...files user:777

Home is owned by the user with 777 perms for testing purposes


# Secure defaults
# See: https://stribika.github.io/2015/01/04/secure-secure-shell.html
Protocol 2
HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/ssh_host_rsa_key

# Faster connection
# See: https://github.com/atmoz/sftp/issues/11
UseDNS no

# Limited access
PermitRootLogin no
X11Forwarding no
AllowTcpForwarding no

# Force sftp and chroot jail
Subsystem sftp internal-sftp
ForceCommand internal-sftp
ChrootDirectory %h

# Enable this for more logs

I cannot figure out what is stopping me from renaming files

Picture of the error

Steps to reproduce: -Copy docker-compose.yml -Edit to function in your environment -docker-compose up


version: '3'


image: atmoz/sftp
  - "4570:22"
  - "./DIRECTORY_TO_COPY:/home/${NAME}/home/Storage"

command: ${NAME}:${PASSWORD}:1001
  • 1
    Please edit your question to show the actual command that you're running and the permissions of the file being renamed and the directory it's contained in. If you're trying to move it into a different directory, include the permissions of the second directory.
    – Kenster
    May 23 '20 at 13:44
  • I added the relevant information, I'm using winscp and have full permissions (0777) to the parent directory, current directory, and the file being renamed. May 23 '20 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.