Why does one Filezilla upload always change file permissions?

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
helices
500 Command not understood
Posts: 4
Joined: 2018-11-09 15:47

Why does one Filezilla upload always change file permissions?

#1 Post by helices » 2018-11-09 16:10

We have a Linux host running sshd, to which hundreds of clients connect to SFTP files to and from it. During my time here, millions of files have been transferred to and from this server without incident.

Until last month, when a new client began uploading files to us using Filezilla. All files from all other clients result in file permissions: 0644 after upload. This new client's files always end up file permissions: 0604 , which is a problem for us because the automation that processes that file runs as a member of the group, and now has permission '0' which always fails.

Using Filezilla from my desktop, I have transferred files that are 0604 on sender side, and result in 0644 on the server. We have sshd_config using this:

Subsystem sftp internal-sftp -f AUTHPRIV -l VERBOSE -m 644

We even put a .profile in this client's chroot home directory containing:

umask 022

Regardless, when they trasfer files, they always end up: 0604

No matter how we test transfer files, regardless the original file permissions, they always end up: 0644

What am I missing?

Please, advise. Thank you.

~ Mike

User avatar
boco
Contributor
Posts: 24154
Joined: 2006-05-01 03:28
Location: Germany

Re: Why does one Filezilla upload always change file permissions?

#2 Post by boco » 2018-11-11 23:12

FileZilla does not care for any file permissions at all. They are set by the server software or the server's file system.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

helices
500 Command not understood
Posts: 4
Joined: 2018-11-09 15:47

Re: Why does one Filezilla upload always change file permissions?

#3 Post by helices » 2018-11-12 13:52

Did you actually read my post?

Clearly, what you say is false.

~ Mike

helices
500 Command not understood
Posts: 4
Joined: 2018-11-09 15:47

Re: Why does one Filezilla upload always change file permissions?

#4 Post by helices » 2018-11-21 14:57

OK, I get that, under default conditions, "FileZilla does not care for any file permissions at all."

In our case, perhaps, a "misconfigured" Filezilla _is_ changing file permissions on our server.

How could I do this, if I wanted, with Filezilla?

~ Mike

User avatar
boco
Contributor
Posts: 24154
Joined: 2006-05-01 03:28
Location: Germany

Re: Why does one Filezilla upload always change file permissions?

#5 Post by boco » 2018-11-21 17:43

No, you can not even mis-configure this. FileZilla itself does not care at all about any permissions. The feature to set permissions is only for user convenience and might not work at all. Again: FileZilla acts only if the user explicitly requests it. It's one of the design principles: Human user is fully in charge.

- FileZilla's SFTP support is based on a slightly adapted component of the PuTTY suite (psftp => fzsftp). Cannot speak for that third-party component's code, @botg would have to check that.
- Unfortunately, my knowledge of SSH2/SFTP is very limited. I have no idea if the SFTP subsystem (FileZilla doesn't support the full SSH2 protocol) of the server even checks for and applies the config file you mentioned (.profile). FileZilla certainly ignores it, it doesn't care.

Is there any pattern for that behavior? For example, wrong permissions could be inherited from a incorrectly 604-tagged directory in the file system.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 31591
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Why does one Filezilla upload always change file permissions?

#6 Post by botg » 2018-11-21 17:57

SFTP does have the capabilities to change the permission bits.

helices
500 Command not understood
Posts: 4
Joined: 2018-11-09 15:47

Re: Why does one Filezilla upload always change file permissions?

#7 Post by helices » 2018-11-21 19:58

Client has multiple datacenters, all uploading to their master office. This "master" office uses one instance of Filezilla on Windows for these SFTP uploads to our server. All files from this client go to the same directory on our server.

One originating datacenter generates files 0604. All other files, regardless originating datacenter, arrive and stay 0644 on our server.

As stated in the original post, we have tested SFTPing files (of several different file permissions) to that same account on our same server, from various Linux and Windows hosts - all files end up as 0644. We have used several client programs, including Filezilla, none of which - in our tests - produce that errant result.

Yes, I know, one solution is to have that one problem datacenter change file permissions _prior_ to sending to the "master" office.

What I want to know is, how can Filezilla upload files resulting in 0604 file permissions?

The single common denominator for this problem is Filezilla at this "master" office.

What else can it be?

~ Mike

User avatar
boco
Contributor
Posts: 24154
Joined: 2006-05-01 03:28
Location: Germany

Re: Why does one Filezilla upload always change file permissions?

#8 Post by boco » 2018-11-22 02:18

Well, the most mysterious thing is that Windows does not support UNIX-type permissions at all (maybe except on this new WSL thingy). So, if they indeed use FileZilla on Windows, the UNIX permissions are stripped from the files. How should they upload (and change) if they are not there?

[Wild speculation]The whole thing reminds me of what happens with some types of defective hardware (RAM).

Group perm 4 would be 00000100, and
Group perm 0 would be 00000000.

Somehow a bit gets flipped, somewhere, and it would have to be on *NIX ground where the values are actually stored.[/Wild speculation]
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
All FileZilla products fully support IPv6. http://worldipv6launch.org
### END SIGNATURE BLOCK ###

User avatar
botg
Site Admin
Posts: 31591
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: Why does one Filezilla upload always change file permissions?

#9 Post by botg » 2018-11-22 08:12

Do you by chance have some users uploading files from a non-Windows system with others uploading files from a Windows system?

Most operating system have traditional Unix permissions. SFTP clients run on those systems typically preserve permissions when transferring files, the permissions on the server will be the same as on the source machine.

The exotic Windows platform is the odd one, it has no concept of Unix permissions. Instead it uses some over-complicated permission system based on ACLs. When uploading using SFTP from such a system the target file gets whatever permissions the server seems fit as default.

Post Reply