LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-16-2003, 08:56 AM   #1
knueven7
LQ Newbie
 
Registered: Mar 2003
Posts: 25

Rep: Reputation: 15
umask


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.
 
Old 04-16-2003, 10:43 AM   #2
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
man umask

But for what you are doing, I think you need to look at chmod:

man chmod

If I understood you correctly:
chmod -R 664 /path/to/dir/

/edit
sry, I misread you're post. 'man umask' should be self explanatory, bust basically whatever you set it to, it subtracts from the permissions.

Last edited by cuckoopint; 04-16-2003 at 10:48 AM.
 
Old 04-16-2003, 10:51 AM   #3
knueven7
LQ Newbie
 
Registered: Mar 2003
Posts: 25

Original Poster
Rep: Reputation: 15
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.
 
Old 04-16-2003, 12:13 PM   #4
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
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...
; )

sry I couldn't be more helpful.
 
Old 04-16-2003, 12:51 PM   #5
knueven7
LQ Newbie
 
Registered: Mar 2003
Posts: 25

Original Poster
Rep: Reputation: 15
umask

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?
 
Old 04-16-2003, 03:09 PM   #6
whegge
LQ Newbie
 
Registered: May 2002
Location: IL
Distribution: RedHat
Posts: 1

Rep: Reputation: 0
What FTP server are you using? Most FTP servers have a way for you to do what you want built in to them, usually a configuration setting.
 
Old 04-17-2003, 01:46 PM   #7
knueven7
LQ Newbie
 
Registered: Mar 2003
Posts: 25

Original Poster
Rep: Reputation: 15
umask

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.
 
Old 04-17-2003, 07:05 PM   #8
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
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...?
 
Old 04-18-2003, 08:30 AM   #9
knueven7
LQ Newbie
 
Registered: Mar 2003
Posts: 25

Original Poster
Rep: Reputation: 15
umask

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.
 
  


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
Umask Randvegeta Linux - Software 3 11-27-2009 08:52 AM
umask trophy Linux - General 1 04-03-2004 02:17 AM
umask=0,0,0 demmylls Linux - General 2 09-15-2003 01:13 PM
Umask robyso Linux - Security 1 07-14-2003 03:33 PM
umask Spaz17 Linux - Newbie 1 07-04-2003 11:12 AM


All times are GMT -5. The time now is 01:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration