Filezilla (SFTP) sets Different Permissions compared to SSH
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Filezilla (SFTP) sets Different Permissions compared to SSH
I have a little web space on a friends server.
It was previously some ubuntu server, but is now "Apache/2.2.22 (Debian)".
In both cases i had the problem that some files have group write permission, some don't.
files created by me.
the files created with filezilla have no group write permissions.
the files created with ssh console have group write permissions.
Code:
$ ls -al
(snip)
drwxr-xr-x 2 me www-data 4096 Sep 20 12:56 madewithfilezilla
drwxrwxr-x 2 me www-data 4096 Sep 20 12:47 madewithssh
i am trying hard to understand why this happens, especially since sftp seems to be using ssh, as well.
i cannot find anything relevant in ~/.ssh/config or /etc/ssh/ssh_config or "man ssh" or "man sftp".
(there is an underlying problem with ownership - something keeps changing ownership of my webroot, so i don't own the files anymore, and if i don't have group write access, i can't change them anymore. i am discussing this with the server owner, but he's not so linux-savvy.)
Hi there,
Have you tried to execute #chmod g+s /foldername ?
This will set the group ID for any new files created inside that folder.
Delete all test-files and retry after execute the command.
thanks nembo81.
chmodding might help, but filezilla does not give this functionality (at least not as a default setting). i will try it, but i would hate to have to use ssh everytime i want to create a folder. my workflow has been somewhat dependent on filezilla.
btw, why did you put a slash (='/') in front of the foldername?
the article is very interesting and goes very much in the right direction.
indeed my domain's homefolder's .bashrc uses 002 as umask (probably changed at some point to countereffect the mysterious chown).
unfortunately this, too, requires server-side adjustment. which i don't have the permissions to do.
if i could tell filezilla to tell sftp to use a different umask?
Filezilla (SFTP) sets Different Permissions compared to SSH
I put the "/" in front of the folder because I thought it's the homedir of all sftp users...isn't it?
In that case with root you can set chmod g+s.
anyway,in the article there is a sample script;You can wrap filezilla start script inside that. Obviously you can do that with root user.
By default, new files have permissions set by umask.
However, your client may apply different permissions after file creation, by default, or the sftp server might be configured to apply different permissions on new files...
@smokeyjustme, both you and the article previously mentioned talk about the sftp server.
i don't think the solution applies if i connect from my local machine, yes?
because i do not have root access to that server.
i have to wait til my friend gets back from his holiday and ask him to do something about it (in 2 weeks) - until then i'm reduced to client side & non-root solutions.
meaning: on my computer, and on my home folder on the server.
i see that in my remote home folder (on my friend's server) there's a umask set "002" in .bashrc, which, afaiu, gives new files group write permissions.
this works with ssh, but filezilla, which is set to use sftp, does not seem to use this umask. the article suggests, to my understanding, that this indeed happens and can be changed server-side, which i understand to mean "not on my local machine".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.