File ownership issue

Advertisement

SSCB
Guest

File ownership issue

Hello, Martin -

When I transfer a file from Windows 2000 to Linux using WinSCP,
the file created on the Linux system is owned by the account used to login
via WinSCP. This is true when the file did not previously exist on the Linux
system.

When a second WinSCP session is established between the Windows 2000
system and the Linux system, using a different account, and a file with the
same name is transferred to the same location on the Linux system, the
transfer occurs without a problem, BUT, the ownership of the file remains
unchanged. In otherwords, the account which first uploaded the file is listed
as the owner of the file, even after the original file was replaced by a different
user.

Is this behaviour caused by sshd, WinSCP, or some mysterious force in the Universe?

The Linux system must recognize that the accounts used in the attempts are different,
as the initial remote directories for the sessions are each user's home directory
on the Linux system. This is also confirmed when the second user performs the following
two-step process - first using WinSCP to explicitly delete the first user's file, and
then transfering a file with the same name to the Linux system - the replacement file
is properly listed as being owned by the second user.

When these users use a command line SSH login to the Linux system, and copy
files with the same name into the shared directory, the file is owned by the
user who most recently replaced/modified the file.

Ideally, we would like the file ownership of files uploaded via WinSCP to the
Linux system to be the account of the person who most recently uploaded the files,
and not the account of the person who first uploaded the files.

Any information you can provide would be most appreciated.

Thanks!

Michael

Configuration:
WinSCP version: 3.6.7 (Build 241)
Transfer protocol: SCP & SFTP (v3) [using SFTP seems to introduce permission issues with our particular configuration]
Interface style: Norton commander

P.S. WinSCP is really an outstanding package - thanks for providing such a
useful tool to the public!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: File ownership issue

When overwritting file, WinSCP "overwrites" it, it does not delete it and create new one. Is such case it is AFAIK regular *nix behaviour to leave file properties (owner, permissions, etc) as is. Am I right? (I'm not an unix expert).

Reply with quote

Guest

Re: File ownership issue

martin wrote:

When overwritting file, WinSCP "overwrites" it, it does not delete it and create new one. Is such case it is AFAIK regular *nix behaviour to leave file properties (owner, permissions, etc) as is. Am I right? (I'm not an unix expert).

You are correct - I've confirmed this with one of our resident Unix experts,
who said that the SSH code on the server side probably does exactly that (i.e.,
opens the existing file, overwrites its contents, then closes it; the file's owner
is not changed, since the file was not created again (just "updated")).

Thanks for your response - I apologize for not getting back to you sooner, but
I left for vacation on the 13th, and didn't return until the 23rd (I'm still
trying to tie-up my pre-vacation loose ends!).

Thanks again!

Michael

Reply with quote

Advertisement

You can post new topics in this forum