Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have no idea how to use umask. I am trying to make it so when someone (anyone) writes/creates anything in a certain directory the permissions are set to user read write group read write and everyone read. Do I have to change this per user or can I do it by individual directory and how do I do it.
I did chmod already, but the problem is with FTPing. When I create a webpage on my machine and upload via FTP it does not take on the permissions of the directory. I then have to physically go to the server and re-chmod the directory.
If this was something as simple as a 'cp', you could just make a script that saves the original umask, changes it, copies the file, and then changes the umask back. But I don't know how to get this working over ftp (and I don't know of a way to get the directory to enforce permissions). If know one comes with some help, I guess all you're left with is to edit your behavior somewhere in the creation process - ie. lets say you use 'touch' to create the file, then make a little alias to replace it with ftouch (or something) which automatically changes the permission. This will give you some less typing, but comes no where near of solving your problem (esp. if different people upload to this server). I haven't done much with ftp, but maybe you can create a script to chmod the directory everytime something is uploaded...
; )
The user (ftp_user) I have using ftp is a member of the www group. I can create a file and ftp it and the owner can stay the same(ftp_user) the group is already the same as the group that owns the directory (www), but I just need to take off the everyone write,execute permission and add group write. Is there no easy way to change the default permissions a user assigns to the files they create?
Okay I got the ftp figured out (you can just change the values in the config file), but what about when a user creates a file, saves it to their desktop and then moves it to a restricted shared drive. I have users that do this and are members of a group (opla) but when it gets stored on the shared drive the person that created the document is the only one that can do anything with it, other group members are denied access. I want the group to have full access to the files created by other members of their group.
can't you just tell the users to change the group of the file to opla before uploading?
Or I guess you can write some script to chgrp the files before/after the actual upload.
I'm just not sure how to automate this. Either attach this script to execute after anytime ftp is run (not very effective), or maybe some kind of cron job...?
they don't need to change the group before they upload because they are already uploading as the correct group, but they do not upload with the group write/enter permissions, just read.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.