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.
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?
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.
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....
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.