LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-13-2011, 07:15 AM   #1
ashish_1985@ymail.com
LQ Newbie
 
Registered: Feb 2011
Posts: 9

Rep: Reputation: 0
Umask on user


Hello

Here in my organization all pc are ubuntu. Now, I want to develop umask on user.

scenario is that person (who loged in) can only access his home directory not others home directory.

Please Guide me.
 
Old 09-13-2011, 08:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
/etc/login.defs and /etc/profile (and other shells) umask setting should be (0)027, then chmod 0700 all users homes: 'find /home/* -maxdepth 0 -type d -print0 | xargs -0 -iD chmod 0700 'D';'. Beware any user may change it back to 1777 or whatever else as they own their own home directory. Nothing keeps you from having a PAM script run on user login to correct things or set an inotify watch to change it back though. (FWIW chrooting users probably won't be efficient as you need to copy in all necessary binaries.)
 
Old 09-14-2011, 04:05 AM   #3
ashish_1985@ymail.com
LQ Newbie
 
Registered: Feb 2011
Posts: 9

Original Poster
Rep: Reputation: 0
Hi

Thanks for reply, I find the files but not content which you mentioned. Please specify
 
Old 09-15-2011, 11:25 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
In /etc/login.defs that would be a line
Code:
UMASK 027
and in say /etc/bashrc a like
Code:
umask 0027
See 'man 1p umask', 'man login.defs' and your shells manual pages for more details.
 
1 members found this post helpful.
  


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
change umask of user kernelzack Linux - Software 3 01-07-2010 07:14 PM
User umask Harlin Linux - Security 1 08-13-2007 09:37 AM
Set umask for user in KDE jferrando Linux - Security 2 01-12-2005 10:41 AM
umask for a user super-momo Debian 5 06-27-2004 01:15 PM
different umask for different user macgyver Linux - Security 6 04-17-2002 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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