LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-13-2008, 02:05 PM   #1
Supreme
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
Vsftpd Upload Permission


I have tried everything that I can think of however I can not get vsftpd to change the upload permission of any of the files I upload. I am using a Virtual User setup for vsftpd. Uploading files work with no problems. When files are uploaded there only readable by the virtual user example

lftp Uploads@> put test.mp3
7364900 bytes transferred
lftp Uploads@> ls
-rw-r--r-- 1 ftp ftp 2359350 Feb 05 02:56 Desktop Background.bmp
-rw------- 1 ftp ftp 7364900 Mar 13 18:20 test.mp3

I would like for the file to lease have permission of -rw-r--r--

Here is my configuration file.

cat vsftpd.conf
anonymous_enable=NO
local_enable=YES
#local_umask=066
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
listen=YES
data_connection_timeout=120
user_config_dir=/etc/vsftpd_user_conf
pasv_enable=YES
max_per_ip=2
max_clients=2
hide_ids=YES

cat vsftpd_user_conf/Uploads
anon_world_readable_only=YES
write_enable=YES
anon_upload_enable=YES
anon_umask=066
local_umask=066

The directory is owned by the virtual user

ls -lash Ftp/
total 47M
0 drwxrwxrwx 3 virtual virtual 264 2008-03-13 13:29 .
2.3M -rw-r--r-- 1 virtual virtual 2.3M 2008-02-04 20:56 Desktop Background.bmp
7.1M -rw------- 1 virtual virtual 7.1M 2008-03-13 13:35 test.mp3

Any help would be greatly appreciated.
 
Old 03-14-2008, 10:50 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
I think you may want anon_umask=022. this should then apply a permission of 755 (directory) or 644 (file).

Code:
file=
bits: 666
mask: 066
perm: 600 (-rw------)

bits: 666
mask: 022
perm: 644 (-rw-r--r--)
 
Old 03-14-2008, 11:04 AM   #3
weisso5
Member
 
Registered: Oct 2007
Location: New York City
Distribution: Gentoo, FC
Posts: 133

Rep: Reputation: 16
you need to add the following lines to your config:

chown_uploads=YES
chown_username=ftp (or whatever user has the permission you want)

Also for security i would add this:

nopriv_user=ftpsecure

You can always get some more basic info from:
/etc/vsftpd/vsftpd.conf.example

Let me know if you have any more problems,

-weisso
 
Old 03-14-2008, 02:11 PM   #4
Supreme
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks rayfordj

I have made the change you suggested and it resolved my issue. Not sure what I was thinking, I was under the impression that anon_umask was using the standard linux permission. Not the umask standards, that is poor over sight on my part.

Weisso I have also taken your suggestion into consideration. I will do a little research and make sure that I set the options properly before I make any changes. Once again thank you guys for the assistance in this matter.



This is what fixed my problem if anyone else has this same issue. I added anon_umask=022 to my Uploads configuration.

cat vsftpd_user_conf/Uploads
anon_world_readable_only=YES
write_enable=YES
anon_upload_enable=YES
anon_umask=022
#local_umask=066

Results

lftp Uploads> put test.mp3
7364900 bytes transferred

lftp Uploads> ls
-rw-r--r-- 1 ftp ftp 2359350 Feb 05 02:56 Desktop Background.bmp
-rw-r--r-- 1 ftp ftp 7364900 Mar 14 18:20 test.mp3


Once again thank you guys for the assistance in this matter.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd upload problem in RH nkd Linux - Newbie 2 10-05-2007 10:06 PM
vsftpd 1.1.3 - Permission Denied on upload garrett7 Linux - Networking 0 09-29-2004 07:49 AM
vsftpd upload limit juergenH Linux - Networking 1 11-17-2003 04:58 AM
VSFTPD - can download but cant upload. Dirt Linux - Software 1 09-06-2003 08:42 PM
Anonymous upload with vsftpd 1.1.0 Jesus0190 Linux - Software 0 01-04-2003 05:40 PM


All times are GMT -5. The time now is 06:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration