WinSCP не может перезаписать файл без разрешения на запись в содержащий каталог

1183
Renu

Я хочу перезаписать файл с правами доступа 777, но каталог, в котором находится файл, имеет права доступа 755. Поэтому он не позволяет этого делать.

1
Может включать в себя точное сообщение об ошибке, которое вы получаете, или даже лучше часть файла журнала? Martin Prikryl 10 лет назад 0

2 ответа на вопрос

0
Hennes

I suggest changing the permissions on the directory.

A short recap of your post with irrelevant parts left out:
I want to WRITE a file ... to a directory which is not writable for anyone bar the users. I am assuming that you are not logged in as that specific user.

That is, the 755 rights are:

  • User: read (r), write (w), cd into directory (x)
  • group: read (r),cd into directory (x)
  • other: read (r),cd into directory (x)

Ergo only the user which own the directory is allowed to write to it. You might want to replace a writable file in that directory but that is the same as writing to a public dairy (777, not locked) in a locked cabinet. It fails because the cabinet is locked.


(If you think: why should I write to the directory and not just the file: The directory will be updated with things like last accessed, size, ....)


Other things which I assumed:

  1. You are not using ACL.
  2. This is not some special folder (such as /dev, /proc, ....)
0
Martin Prikryl

Your question is pretty vague.

But I would assume you are having the problem because WinSCP tries to transfer to a temporary file first, what conflicts with your lack of create-file permissions.

Turn off Transfer Resume/Transfer to Temporary Filename preference option in WinSCP:
https://winscp.net/eng/docs/ui_pref_resume

Похожие вопросы