LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-10-2004, 02:01 AM   #1
bkali4nia
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
vsftp umask question


Despite having set umask to 022 in vsftpd.conf, files uploaded to ftp/pub folder ends up with -rw------- permission.

Desired result is being able to upload and download freely on the FTP using anonymous access.

Currently, files can be uploaded but not downloaded.

How do I set uploaded files to have default permission of -rw-r--r--?

Last edited by bkali4nia; 04-10-2004 at 02:03 AM.
 
Old 04-12-2004, 12:16 PM   #2
bkali4nia
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Found solution

found solution by typing

man vsftpd.conf

This gives complete list of vsftpd parameters not listed in default .conf file.

found that there is a separate umask parameter for anonymous users.

anon_umask=022

This will set umask for anonymous users to 022

Also,

anon_other_write_enable=YES

will allow anonymous users to erase and rename files on your ftp server.
 
Old 04-25-2004, 02:42 PM   #3
rbrightwell
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
022 will work, however 0022 is more correct since the man page says that all octal values must be preceeded by a zero. So, those of you that try using a different value, such as local_umask=222 are gonna be in for a rude suprise when the 222 is read as a decimal 222 and converted to 336 octal. The correct usage would be local_umask=0222. By using the four digit values all the time any future confusion can be avoided.

Also, don't forget that there is a default file_open_mode=0666 if you don't specify one in your config file. This will affect the default file permissions as well.
 
Old 04-25-2004, 02:44 PM   #4
rbrightwell
LQ Newbie
 
Registered: Apr 2004
Posts: 2

Rep: Reputation: 0
ok... ok... I know my reply talks about local_umask but the same applies to anon_umask. Use four digits for a long happy life. :-)
 
Old 01-29-2006, 06:31 PM   #5
Godji
LQ Newbie
 
Registered: Dec 2004
Posts: 9

Rep: Reputation: 0
I have the same problem!

I want to set up an anonymous read-only vsftpd server where only a single upload folder is writeable. Uploading folders is fine, but files get the wrong permissions. My setup looks like this:

I have the user "ftp" with a home folder of /home/ftp which looks like this:

Code:
Superfly ftp # ls -a
total 12
dr-xr-xr-x 3 ftp  users 4096 Jan 29 20:21 .
drwxr-xr-x 6 root root  4096 Jan 28 19:38 ..
drwxrwxr-x 4 ftp  users 4096 Jan 29 20:47 upload
The upload folder looks like this:
Code:
Superfly ftp # ls upload/
total 56
-rw------- 1 godji users    2 Jan 29 19:12 hello.txt
-rw------- 1 godji users  453 Jan 29 20:02 m.txt
-rw------- 1 godji users  453 Jan 29 19:42 mm.txt
-rw------- 1 godji users  453 Jan 29 19:51 mm2.txt
-rw------- 1 godji users  453 Jan 29 20:26 mmmmmm.txt
-rw------- 1 godji users  453 Jan 29 19:59 mmt.txt
-rw------- 1 godji users  453 Jan 29 20:40 n.txt
-rw------- 1 godji users  453 Jan 29 20:44 n1.txt
-rw------- 1 godji users  453 Jan 29 20:47 n2.txt
-rw------- 1 godji users    2 Jan 29 19:25 argh.txt
drwxr-xr-x 2 ftp   users 4096 Jan 29 20:38 test
-rw------- 1 godji users    2 Jan 29 09:48 test.txt
drwxrwxr-x 2 ftp   users 4096 Jan 29 20:39 test2
-rw------- 1 godji users    2 Jan 29 19:13 wee.txt
All .txt files have been uploaded by an anonymous client. I want them automatically transferred to the "godji" user (my daily account) so that I can easily move them away from KDE. I'm aiming at "-rw-rw-r--". My vsftpd.conf is the following:

Code:
Superfly ftp # cat /etc/vsftpd/vsftpd.conf
accept_timeout=60
allow_anon_ssl=YES
anon_max_rate=0
anon_mkdir_write_enable=YES
anon_other_write_enable=NO
anon_root=/home/ftp
anon_umask=0002
anon_upload_enable=YES
anon_world_readable_only=YES
anonymous_enable=YES
ascii_download_enable=NO
ascii_upload_enable=NO
async_abor_enable=NO
background=NO
check_shell=YES
chmod_enable=NO
chown_uploads=YES
chown_username=godji
chroot_list_enable=NO
chroot_local_user=NO
connect_from_port_20=YES
connect_timeout=60
data_connection_timeout=300
deny_email_enable=NO
dirlist_enable=YES
dirmessage_enable=NO
download_enable=YES
dual_log_enable=NO
file_open_mode=0666
force_dot_files=NO
force_anon_data_ssl=YES
force_anon_logins_ssl=YES
force_local_data_ssl=YES
force_local_logins_ssl=YES
ftp_data_port=20
ftp_username=ftp
ftpd_banner=The Superfly FTP server is running Linux!
guest_enable=NO
guest_username=ftp
hide_ids=YES
idle_session_timeout=300
listen=YES
listen_ipv6=NO
listen_port=21
local_enable=NO
local_max_rate=0
local_root=/home/ftp
local_umask=0002
lock_upload_files=YES
log_ftp_protocol=NO
ls_recurse_enable=NO
max_clients=0
max_per_ip=0
mdtm_write=YES
no_anon_password=YES
no_log_lock=NO
one_process_model=NO
passwd_chroot_enable=NO
pasv_addr_resolve=NO
pasv_enable=YES
pasv_max_port=0
pasv_min_port=0
pasv_promiscuous=NO
port_enable=YES
port_promiscuous=NO
run_as_launching_user=NO
secure_email_list_enable=NO
session_support=NO
setproctitle_enable=NO
ssl_enable=NO
ssl_sslv2=NO
ssl_sslv3=NO
ssl_tlsv1=YES
syslog_enable=NO
tcp_wrappers=NO
text_userdb_names=YES
tilde_user_enable=NO
trans_chunk_size=0
use_localtime=NO
use_sendfile=YES
userlist_deny=YES
userlist_enable=NO
virtual_use_local_privs=NO
write_enable=YES
xferlog_enable=YES
xferlog_std_format=NO
I've been looking around the web but most problems are solved by either setting anon_umask or file_open_mode the way I have them. Please help if you can!
 
Old 03-24-2006, 03:01 PM   #6
fiservguy
Member
 
Registered: Nov 2004
Distribution: RHEL 2.1, RHEL 3.0, SUSE 9.2
Posts: 31

Rep: Reputation: 16
Godji, I'm experiencing the same problem you are. I've got anon_umask=0022, file_open_mode=0666, and have tried several variations on that with no success. Every file that gets uploaded via anonymous ftp has file permissions of 600.

I've read on some sites that this is a but in vsftpd, but I can't find either confirmtation or a fix. This concerns me because some of the tentative bug reports date back over a year.

If anyone has more concrete information, I'd appreciate getting this addressed.
 
Old 03-24-2006, 03:20 PM   #7
ronkymac
Member
 
Registered: Nov 2004
Location: Edinburgh, Scotland, UK.
Distribution: Debian
Posts: 72

Rep: Reputation: 15
make sure all these options are enabled for anonymous upload/download:

anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES

also: the upload or download problem may actually be to do with ASCII encoding.... vsftp tends to reject ACSII uploads as default.

uncomment the line
ascii_upload_enable=YES


hope this helps
regards
 
Old 07-18-2006, 03:01 PM   #8
rich1000
LQ Newbie
 
Registered: Jul 2006
Posts: 3

Rep: Reputation: 0
vsftpd umask question

Issue with file creation/upload...

When a user (we don't use anoymous users) upload a file or directory, we'd like to have the file permissions set to:
664

We'd like all directories created to be:
2775

I can't seem to determine what the correct umask settings in vsftp config file should be. Any help on this?

Thanks
rich
 
Old 05-21-2009, 02:18 PM   #9
crash893
LQ Newbie
 
Registered: Mar 2009
Posts: 6

Rep: Reputation: 0
could someone please explian why sometimes its local_unmask=0xx (2) and other people have it as local_unmask=0xxx (3)
 
Old 12-09-2011, 04:19 PM   #10
scotthill
LQ Newbie
 
Registered: Jan 2009
Posts: 23

Rep: Reputation: 15
Quote:
Originally Posted by crash893 View Post
could someone please explian why sometimes its local_unmask=0xx (2) and other people have it as local_unmask=0xxx (3)
Yes, please I need the explanation also.
The documentation in vsftpd.conf says change to: local_umask=022 which is not working for me. My client is trying to set the permission to 533 and it says that it failed to do that.

Lost
 
Old 01-28-2012, 02:24 PM   #11
GordieH
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Thumbs up Permission Information

Quote:
022 will work, however 0022 is more correct since the man page says that all octal values must be preceeded by a zero. So, those of you that try using a different value, such as local_umask=222 are gonna be in for a rude suprise when the 222 is read as a decimal 222 and converted to 336 octal. The correct usage would be local_umask=0222. By using the four digit values all the time any future confusion can be avoided.

Also, don't forget that there is a default file_open_mode=0666 if you don't specify one in your config file. This will affect the default file permissions as well.
THANK-YOU rbrightwell!! The permissions being preceded by the 0 was what was throwing my setting off!
 
Old 12-31-2013, 02:59 AM   #12
sudhi_naidu
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 0
anonymous upload permissions

If you have used the options chown_uploads=YES, chown_username=someuser then anon_umask will not used to determine the permissions of anonymously uploaded files. Use "chown_upload_mode" option to set anonymously uploaded files. as in below;

chown_uploads=YES
chown_username=ftp
chown_upload_mode=0644

This would give 644 permissions for anonymously uploaded files.

As per "man vsftpd.conf" chown_upload_mode option was Added in v2.0.6.

Last edited by sudhi_naidu; 12-31-2013 at 03:02 AM.
 
  


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
VSFTP question basemodel Linux - Software 1 02-27-2004 10:50 PM
vsftp umask and permission problem dagalicous Linux - Software 2 10-22-2003 08:55 PM
ProFTPD Umask question..... hct224 Linux - Newbie 2 10-21-2003 10:03 AM
simple umask question danahata Linux - General 8 08-26-2003 11:04 AM
umask Question gauge73 Linux - Newbie 2 07-09-2003 07:16 PM


All times are GMT -5. The time now is 01:41 PM.

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