LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-18-2002, 11:55 PM   #1
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Rep: Reputation: 15
Ftp permission problem


Everytime I publish a new page via ftp I am unable to view it via a browser unless I chmod the file.

I have created a user and give ownership of the home dir to the user.

How do I enable a default ownership that allows new files to be published and viewed without "Permission Denied" and without having to chmod each file?

I have tried:
umask 022 /home
without success.

Thanks.

Last edited by 360; 02-19-2002 at 08:42 AM.
 
Old 02-19-2002, 04:11 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
As far as I know you don't set the umask for a specific directory. But you set it for a user. Every file that the user then creates will get modified using the umask. But using the umask won't set extra bits. If you would be using a umask of 022. Then a file with permissions rw-rw-rw- would become rw-r--r--. A file with the permissions rw------- would remain the same. So you should make sure the original files are already created with the right permissions. Setting the umask for the user who creates the files properly might help. Or you could add a cron script which automatically sets the permissions right in your upload directory.
 
Old 02-19-2002, 05:05 AM   #3
dnar
Member
 
Registered: Feb 2002
Location: Perth, Australia
Distribution: FC5 ::: Coyote ::: SCO Unixware :::
Posts: 201

Rep: Reputation: 30
I am curious too, as to what determines the initial attributes of new files. umask in fact SUBTRACTS the mask value, but what sets the initial attributes?

This is one area of *nix that I should know more about, considering I have been a user for over 10 years....
 
Old 02-19-2002, 05:44 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I think that's up to the application itself. The default is usually to always make the file readable and then if it needs to be writeable or executable then those bits will also be set. Usually creating a file in an editor would start it out with rw-rw-rw- which would be adjusted by the umask to the preferred values. With a umask of 022 that would end up to be rw-r--r--.
An ftp server usually strips off the x bit and copies the r and w bits from the original file. The umask can be used to make adjustments.

Last edited by Mik; 02-19-2002 at 05:46 AM.
 
Old 02-19-2002, 10:49 AM   #5
360
Member
 
Registered: Jun 2001
Distribution: FC4
Posts: 136

Original Poster
Rep: Reputation: 15
Ok, here is what I have found...

If the default umask is 022, then a mkdir will create a dir with file permission of 755. 777 is the default permission for a directory minus the umask of 022 so we get 755.

If the default umask is 022, then creating a file with have a permission of 644. 666 is the default permission for a file minus the umask of 022 so we get 644.

To set default permission for files and directories uploaded via ftp, set the server args in /etc/xinetd.d/wu-ftpd to:
server_args = -l -a -u022

The -l option specifies that each FTP session be logged via the syslog facility, and the -a option specifies that the access control configuration specified in /etc/ftpaccess be enabled.

Another thing I found was that a directory must have execute permission for the group others in order for that directory to be browsed by a browser. A file only needs to have read access to be browsed.

end.

Last edited by 360; 02-19-2002 at 12:06 PM.
 
  


Reply



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
permission peroblem using Ftp owais Linux - Networking 1 10-21-2004 05:15 AM
permission changed after get thru ftp for a ELF linuxforever Linux - Networking 0 07-24-2003 05:57 AM
ftp into redhat (permission denied) mrobb Linux - Software 5 05-20-2003 03:13 PM
FTP permission Question Supp0rtLinux Linux - Software 2 04-29-2003 07:03 PM
FTP Permission Denied Rfriend@ucwv.edu Linux - Networking 2 08-23-2001 03:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:08 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration