WinSCP cannot overwrite file without write permissions to containing directory

1

1

I want to overwrite a file having permissions 777 but the directory in which file is placed has permissions 755. So it is not allowing to do so.

Renu

Posted 2014-10-30T05:05:51.960

Reputation: 11

Can include an exact error message you are getting or even better a piece of log file? – Martin Prikryl – 2014-10-30T07:23:20.003

Answers

0

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, ....)

Hennes

Posted 2014-10-30T05:05:51.960

Reputation: 60 739

0

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

Martin Prikryl

Posted 2014-10-30T05:05:51.960

Reputation: 13 764