![]() |
FTP Server
I am in the process of setting up an FTP server my system and ran into an issue and was wondering if someone could offer some advice.
Basically I have setup VSFTPD on our system to allow anonymous uploads/downloads to a directory (/var/ftp/uploads). 1. I can connect fine with credentials Username = ftp Password = ftp (the ftp folder and sub directories are owned by ftp user/group) 2. I can also transfer files transfer to/from the server. The issue seems to be if I create a new file whether it be on my windows machine (then upload to the server) or even create a new file on the linux box, the new file has permission of –rw-------- resulting in a failed transfer of the file if I try to transfer the file (via ftp). If I manually change the permissions (–rwxrwxrwx) then I am able to then to transfer the files successfully. Does anyone have any suggestions? At the end of the day the ultimate goal is for an anonymous user to be able to upload/download files from the server. Not sure if it possible (or most efficient) to have some script/ program run to change the permission of a new file? This was the only idea that came to my mind. Ray Bonds |
You are a little unclear about the files that have the bad permissions. Are these files uploaded to the server in some other way than through FTP? Because right before that you say you can successfully transfer files to and from the server over FTP.
|
The files are uploaded to the server through ftp.
What I meant by I "I can also transfer files transfer to/from the server." is that if i randomly choose a file of the system and set it in the uploads folder it will transfer. I did this for testing purposes just to see if i could transfer a file. |
So you can download a file that is placed in the FTP directory from the local filesystem, but cannot download a file that was actually uploaded through FTP?
In that case it sounds like a mask problem. Try adding the following to your vsftpd.conf file: Code:
anon_umask=0022 |
I attempted to add anon_umask=0022 to the code. This however did not work.
To answer your question yes I can download a file already on the filesystem but can't download uploaded files. |
Did you make sure to restart VSFTPD after changing the file to reload the configuration? Could you post your vsftpd.conf file?
|
Yes i restarted the system after making the change to the config file. Note you suggessted that I use 0022 (i tried this first then changed it to 022)
Code:
|
Quote:
Code:
ls -al /var/ftp /var/ftp/uploads |
Here is the output from running the following command
[root@ip3d dev]# ls -al /var/ftp /var/ftp/uploads Code:
|
Well your permissions should be fine as long as you're trying to upload to the upload directory. Try adding these two lines to your config (don't remove any of the other lines.)
Code:
local_enable=YES(I know you don't want local users in the long run, but your options should be fine otherwise, I'm just testing for a bug I saw once.) One other thing I might mention and it sounds kinda silly, but make sure you're editing the conf file that controls the actual service and not a sample or a duplicate in an alternate location. |
The problem has been semi-solved. I appreciate the input/suggestions from everyone.
I added anon_world_readable_only=NO to the file which allows me to download files that have been uploaded to the server. Code:
[root@ip3d uploads]# ls -lI am still baffled by how even after changing the file_open_mode=0666 anon_umask=0022 in the config file files uploaded to /var/ftp/uploads still have -rw------- permission. Does anyone have any ideas? |
| All times are GMT -5. The time now is 03:08 AM. |