LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-11-2004, 06:20 PM   #1
super-momo
LQ Newbie
 
Registered: Jun 2004
Location: Toronto
Distribution: Debian
Posts: 17

Rep: Reputation: 0
Question umask and public_html


Hello all,

I want to set umask so no one else can read my files. I have `umask 077` in .bashrc, .bash_profile, and .profile. I use gnome2 and gdm in Debian testing. When I create files under gnome-terminal, the permissions are set properly. But when I save files from somewhere else, say GIMP, group and other have read permission again. I suspect that I should put `umask 077` in init script for gdm, but I don't know what it is. .xinitrc and .xsession doesn't seem to work.

And also, is it possible to set umask for an individual directory? I want my public_html to have umask 022 so others can access my files and I don't have to chmod everytime I create a file.

Thanks in Advance.

rxc
 
Old 06-11-2004, 06:44 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
No, it's not possible to assign individual umasks to
a directory ...

You could try setting umask=077 in
/etc/profile
which would mean that new programs you install
as root may have wrong access rights (I don't know
debian well enough to be sure of how apt handles
permissions - it certainly would be a problem if
you installed from source)



Cheers,
Tink
 
Old 06-11-2004, 07:05 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Read through the man page for the mount command. You can have a umask option for a mounted partition. This is close to what you are asking about. Rather than a directory, you can create a seperate partition dedicated for certain types of files with particular group permissions and umask setting.

Another thing to consider, is changing the group ownership of a directory and only allowing execution permission for the group. Then a user who is not a member of the group will not be able to enter the directory.

I use Mandrake Linux. There is a cron scheduled program that checks the permission of files in directories. You may have a similar program running on your system which may be changing the permissions on your saved files. Something to check. If you have a similar program running on your system, you can set it up so the permissions of files in a particular directory are adjusted to your liking.
 
Old 06-11-2004, 07:16 PM   #4
super-momo
LQ Newbie
 
Registered: Jun 2004
Location: Toronto
Distribution: Debian
Posts: 17

Original Poster
Rep: Reputation: 0
I think I tried to put `umask 77` in /etc/profile, but it didn't work. I'll try it again.

What I want is drwx--x--x for my home directory. And rw------- for all files, and rwx------ for all directories in it. I want execute permissions for my home directory because I tried to unset it and my public_html becomes inaccessible.

And yes, my /home is on a separate partition.

Thanks for the help. I am going to try the methods you suggested.

rxc
 
Old 06-11-2004, 10:46 PM   #5
super-momo
LQ Newbie
 
Registered: Jun 2004
Location: Toronto
Distribution: Debian
Posts: 17

Original Poster
Rep: Reputation: 0
I read the man page of mount. I couldn't find a umask option for ext2 file system. It exists for fat, hpfs, ntfs and udf. How should I set the umask for an ext2 partition?
 
Old 06-12-2004, 01:37 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by super-momo
What I want is drwx--x--x for my home directory. And rw------- for all files, and rwx------ for all directories in it. I want execute permissions for my home directory because I tried to unset it and my public_html becomes inaccessible.
As for the x bits, just make the owning group something
that only apache is member of ... you don't need x for other
then.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
public_html not working house_randann Linux - Networking 4 01-05-2007 06:56 PM
Perl in public_html FragInHell SUSE / openSUSE 0 11-17-2005 01:38 AM
localhost and public_html RJDavison Linux - General 5 01-09-2005 02:48 PM
/Public_html Folder....what is it? ZingSter SUSE / openSUSE 3 10-21-2004 05:02 PM
Cgi for public_html Drogo Linux - Software 2 05-29-2003 04:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:27 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