I have a raspberry pi behind a Fritzbox router that also doubles as a nas with a drive connected via USB.

I have mounted the nas to the pi's "/media/fritzbox-usb" directory and would like all users to have full read, write and rename/delete rights.

I used this command, issued as "sudo" from the pi user.

mount -t cifs -o username="fritboxuser",password="fritzboxpassword",uid=1000,gid=1000,sec=ntlm "//" /media/fritzbox-usb

Afterwards, the nas is mounted for all users and it's possible to copy files from it and copy files to it.

When I use WinSCP to connect as the "pi" user, files are uploaded as "filename.ext.filepart" and, after completion, renamed. With this setup, the pi user doesn't have renaming rights, so at the end of the transfer, I get

Error Code 3 - permission denied.

When I SSH into the pi as the pi user, I can issue the "mv filename.ext.filepart filename.ext" command and rename the file.

Any idea what I could do to make direct uploads possible?

Some more info: From winscp I have the right to delete the file. The file permissions are shown as "rwxrwxrwx" and the owner of the file is "pi". Using WinSCP to copy files to folders directly on the pi is fine, only this mounted nas drive is giving problems

  • 1
    This question has nothing to do with Raspberry Pi. You should better ask at superuser.com
    – Ingo
    Jul 5 '20 at 8:33

Disable transfer to temporary file name in WinSCP preferences on Transfer > Endurance page:

See also https://winscp.net/eng/docs/resume#automatic.

  • Thanks, this approach removes the chance to continue interrupted transfers, so it works for smaller files, but is risky for lange files (since my IP address changes every night this would make nighly uploads impossible)
    – 576i
    Jul 5 '20 at 9:48
  • It's still possible to resume the transfer, but it won't happen automatically. Jul 5 '20 at 10:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.