LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   User Accounts (https://www.linuxquestions.org/questions/linux-desktop-74/user-accounts-691200/)

mashcaster 12-19-2008 02:34 AM

I ran for following after su'ing into root:

grep -i "umask" /etc/*

and

grep -i "umask" ~/.*

and found that there were umask entries in the following files

/etc/profile
~/.bashrc

I changed the umask entry in /etc/profile from 022 to 077 and commented out the umask entry in ~/.bashrc

Because of the current bug, I added

umask 002

to /etc/gdm/Xsession

After restarted the system, I logged in as a standard user, created a file, checked the permissions and the permissions are set to

-rw-rw-r--

What have I missed out?

mashcaster 12-19-2008 02:45 AM

Nevermind, got it working by changing 002 to 077 in /etc/gdm/Xsession.

rweaver 12-19-2008 08:45 AM

Quote:

Originally Posted by mashcaster (Post 3380880)
<snip>...
umask 002

to /etc/gdm/Xsession

After restarted the system, I logged in as a standard user, created a file, checked the permissions and the permissions are set to

-rw-rw-r--

What have I missed out?

umask 002 = 664 (files) = rw-rw-r--

For what you described umask should be 077 *everywhere* including the /etc/profile, /etc/login.defs, /etc/skel/.bashrc, /root/.bashrc, /etc/gdm/Xsession, etc. The less programs that can weasel around the umask the better. Someone else mentioned /etc/adduser.conf DIR MODE and it should be 700. etc... anywhere you can find to set it... set it.

Quote:

Nevermind, got it working by changing 002 to 077 in /etc/gdm/Xsession.
There ya go :)

mashcaster 12-19-2008 08:58 AM

Quote:

Originally Posted by rweaver (Post 3381147)
umask 002 = 664 (files) = rw-rw-r--

For what you described umask should be 077 *everywhere* including the /etc/profile, /etc/login.defs, /etc/skel/.bashrc, /root/.bashrc, /etc/gdm/Xsession, etc. The less programs that can weasel around the umask the better. Someone else mentioned /etc/adduser.conf DIR MODE and it should be 700. etc... anywhere you can find to set it... set it.



There ya go :)

How do I scan all the files in my harddrive to find all umask's

grep -i "umask" /etc/*

will only look in the folder /etc/

and

grep -i "umask" ~/.*

will only look into my home folder.

rweaver 12-19-2008 11:22 AM

Quote:

Originally Posted by mashcaster (Post 3381163)
How do I scan all the files in my harddrive to find all umask's

grep -i "umask" /etc/*

will only look in the folder /etc/

and

grep -i "umask" ~/.*

will only look into my home folder.

You don't really need to look in the whole system, but looking through the sub directories of /etc wouldn't hurt... try:

Code:

grep -iRI "umask" /etc/* | grep -v "/etc/rc[0-9S].d"
(i case insensitive, R recursive, I ignore binary) (v invert match)

Most of the /etc/rcX.d stuff can be safely ignored also.


All times are GMT -5. The time now is 07:51 AM.