Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
08-23-2007, 01:52 PM
|
#1
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Rep:
|
umask not working
My umask setting is 0077, see below
[root@server ~]# umask
0077
the permission of the new file suppose to be
-rw-------
but what I got is
-rw-rw-rw-
No matter how I change the umask setting (0000, 0011, 0700 etc.), the file permission I got is always -rw-rw-rw-.
Do you know what is wrong with my umask, and how to fix it?
Thank you very much!
|
|
|
08-23-2007, 02:20 PM
|
#2
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
Hi.
That's a bit odd. What type of filesystem are you doing this on? Is it FAT32 by any chance?
If not, try:
Code:
pwd
umask
touch wibble
ls -l wibble
and post the output.
Dave
|
|
|
08-23-2007, 02:20 PM
|
#3
|
Member
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102
Rep:
|
Well it seems to work for me...
Quote:
lakris@ubuntu:~$ umask
0022
lakris@ubuntu:~$ >testfile
lakris@ubuntu:~$ ls -l testfile
-rw-r--r-- 1 lakris lakris 0 2007-08-23 21:16 testfile
lakris@ubuntu:~$ umask 0077
lakris@ubuntu:~$ umask
0077
lakris@ubuntu:~$ rm testfile
lakris@ubuntu:~$ >testfile
lakris@ubuntu:~$ ls -l testfile
-rw------- 1 lakris lakris 0 2007-08-23 21:17 testfile
|
Try to remove the file first (it may retain the permissions it had when it was created)
|
|
|
08-23-2007, 02:55 PM
|
#4
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Original Poster
Rep:
|
My file system is Linux EXT3.
[root@server ~]# pwd
/root
[root@server ~]# umask
0022
[root@server ~]# touch wibble
[root@server ~]# ls -l wibble
-rw-rw-rw- 1 root root 0 Aug 23 15:54 wibble
|
|
|
08-23-2007, 03:17 PM
|
#5
|
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109
Rep:
|
I am completely stumped. Anyone else?
|
|
|
08-23-2007, 03:17 PM
|
#6
|
Member
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102
Rep:
|
did you try to remove the file (or touch a new one) ?
Quote:
root@ubuntu:~# umask
0022
root@ubuntu:~# touch shit1
root@ubuntu:~# ls -la shit1
-rw-r--r-- 1 root root 0 2007-08-23 22:18 shit1
root@ubuntu:~# umask 0077
root@ubuntu:~# touch shit1
root@ubuntu:~# ls -la shit1
-rw-r--r-- 1 root root 0 2007-08-23 22:18 shit1
root@ubuntu:~# rm shit1
root@ubuntu:~# touch shit1
root@ubuntu:~# ls -la shit1
-rw------- 1 root root 0 2007-08-23 22:18 shit1
|
Last edited by lakris; 08-23-2007 at 03:19 PM.
|
|
|
08-23-2007, 03:45 PM
|
#7
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Original Poster
Rep:
|
Quote:
Originally Posted by lakris
did you try to remove the file (or touch a new one) ?
|
Yes, I DID.
|
|
|
08-23-2007, 03:52 PM
|
#8
|
Member
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102
Rep:
|
I'm not sure if this is possible but does the directory have any sticky bits set?
|
|
|
08-23-2007, 04:00 PM
|
#9
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Original Poster
Rep:
|
Quote:
Originally Posted by lakris
I'm not sure if this is possible but does the directory have any sticky bits set?
|
Not sure what is sticky bits set. How to check that?
|
|
|
08-23-2007, 04:02 PM
|
#10
|
Senior Member
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,508
Rep:
|
Quote:
Originally Posted by libin88
My file system is Linux EXT3.
[root@server ~]# pwd
/root
[root@server ~]# umask
0022
[root@server ~]# touch wibble
[root@server ~]# ls -l wibble
-rw-rw-rw- 1 root root 0 Aug 23 15:54 wibble
|
Based on above, your umask is 0022, not 0077 as you told us.
Please, check.
|
|
|
08-23-2007, 04:08 PM
|
#11
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Original Poster
Rep:
|
Quote:
Originally Posted by marozsas
Based on above, your umask is 0022, not 0077 as you told us.
Please, check.
|
It doesn't matter, no matter my umask is, my file permission is always
-rw-rw-rw-
|
|
|
08-23-2007, 04:14 PM
|
#12
|
Member
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102
Rep:
|
Quote:
Originally Posted by libin88
Not sure what is sticky bits set. How to check that?
|
Quote:
lakris@ubuntu:~$ ls -l -d .
drwxr-xr-x 88 lakris lakris 12288 2007-08-23 22:48 .
lakris@ubuntu:~$
|
I don't remember exactly but do You have a t in there instead of x (for group or all)?
The directory isn't by any chance controlled by samba?
What is your shell?
I think this is intriguing!
|
|
|
08-23-2007, 04:24 PM
|
#13
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Original Poster
Rep:
|
Quote:
Originally Posted by lakris
I don't remember exactly but do You have a t in there instead of x (for group or all)?
The directory isn't by any chance controlled by samba?
What is your shell?
I think this is intriguing!
|
NO, there is no t for both group and all. My machine is not using samba either. I am using bash shell.
|
|
|
08-23-2007, 04:29 PM
|
#14
|
LQ Newbie
Registered: Jul 2005
Posts: 20
Original Poster
Rep:
|
Is there way I can re-install umask? I am using FC6.
|
|
|
08-23-2007, 04:33 PM
|
#15
|
Member
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102
Rep:
|
Can You do the following commands:
Quote:
lakris@ubuntu:~$ umask -p
umask 0022
lakris@ubuntu:~$ umask -S
u=rwx,g=rx,o=rx
lakris@ubuntu:~$ umask 0077
lakris@ubuntu:~$ umask -p
umask 0077
lakris@ubuntu:~$ umask -S
u=rwx,g=,o=
lakris@ubuntu:~$
|
What is Your output?
and what does Your /etc/profile say?
Last edited by lakris; 08-23-2007 at 04:41 PM.
|
|
|
All times are GMT -5. The time now is 12:46 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|