通过 SFTP 重命名文件

通过 SFTP 重命名文件

我目前有一个 atmoz/sftp docker 容器设置,只有一个用户。我可以创建/移动/删除文件,但当我尝试重命名文件时,我收到错误代码 3 权限被拒绝。这是使用 winscp 并且文件夹权限掩码为 777。因此,当我尝试重命名文件时,我创建的文件具有权限 777,并且归用户所有。

文件结构:/home root:744 /user root:744 /home user:777 /subdirectory user:777 ...files user:777

房屋归拥有 777 个权限的用户所有,仅用于测试目的

sshd_配置:

# 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
#LogLevel VERBOSE

我不知道是什么阻止我重命名文件

错误图片

重现步骤: - 复制 docker-compose.yml - 编辑以在您的环境中运行 -docker-compose up

docker-compose.yml

version: '3'

services:

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

command: ${NAME}:${PASSWORD}:1001

相关内容