Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
(Resolved)File uploaded via FTP have bad permissions
Hola
I'm using pureFTP with virtual users. The 2 users are chrooted to the apache htdocs directory and for some reason, when I upload a file to the webserver I can't view it. I see permissions denied so I then have to SSH into the box and do a chmod on the dir so I can access the files online.
This is a bit of a pain (even though the box in question is sat next to my desktop machine ) but I would like to resolve the issue.
The owner and group on the htdocs directory in apache is "ftp". This is set so that my ftp users can upload. Without this set, they can connect but not navigate or upload. Anyhow, once they have upload a file it cannot be viewed and as mentioned I have to SSH in a do a chmod on the dir to allow access the files.
I would really appreciate any suggestion that would help me resolve this....
Thanks
Last edited by breakerfall; 12-28-2003 at 04:29 PM.
Actually, your system should have a umask set by default, usually something like 022
If you run the command "umask" you'll see what your system is set to. Basically, this changes the default permissions when a file a created by subtracting that value from 755 for directories and 644 for files. So if you have a umask of 044, when files are created, they are created with 600 for permissions.
What are the permission settings on the files when they are uploaded? (octet version)
Another thought, have you considered adding the users to the ftp group? That should allow them to connect and upload as themselves, not as the ftp user.
Another thought, have you considered adding the users to the ftp group? That should allow them to connect and upload as themselves, not as the ftp user.
I wanted to use virtual users for this FTP rather than adding the users to my system user list.
The umask of my system is 022 as you said it would be.
It doesn't seem to matter what the permissions are on files before they're sent. Even when they have been chmodded to 755.
For example, I send an image to the server:
before sending
Code:
-rwxr-xr-x 1 breakerfall users 86169 Dec 24 03:45 wow.jpg
after sending
Code:
-rw------- 1 ftp ftp 86169 Dec 28 04:07 wow.jpg
The real strange thing is that I wasn't having problems the other day. This wasn't an issue and both myself and my friend could FTP into the server and upload files and access them online just fine. I just freshly installed the system on that machine so I have been making changes constantly the past few days which could have caused the problem.
I don't know if it could be related but the only thing I can think of is the fact that I re-compiled PHP for apache and mysql just yesterday.
Quote:
What are the permission settings on the files when they are uploaded? (octet version)
I do not know the values yet. Is there a way of finding out and are you referring to the numerical value of the w, r, x etc? I haven't dabbled with file permissions up to know: there's a lot to learn and not enough hours in each day
Now that I think about it, the umask can be set for individual users as well (I think). Try logging into your system as the user ftp and see what the umask is. It seems to be behaving like it's set to 044.
The only other thing I can think of is you've got something configured in your ftp application that's setting those permissions.
The umask showed up as 022 when logging in via ssh using the ftp user. I have even tried removing the FTP user from the system and re-creating it, recreating the virtual users... all to no avail
I'm really not sure what I can do.... I have tried re-creating the virtual users to work from a different user and group other than ftp. The problem is definately server side because the same thing happens to my friend when he uploads to the server.
Sorry for wasting your time, I can be a dunce sometimes :|
I just went through my pure ftp config file and saw an incorrect entry. Something I should have done when I first noticed the problem. Thanks for all your help
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.