I have about 2 years of Linux experience, but I haven't had a reason to learn about umask until just recently.
I am working on a RedHat 2.1 Advanced Server box.
I am trying to set up a non-root user for routine system maintenance, and I need new files created on the box to allow full permissions to both root and members of the file's group.
# ll -ha newfile
# rw-r--r-- newfile .... etc....
The output above is what I get normally.
Now, I changed the umask manually and tested it like this:
# umask 002
# ll -ha newfile-afterchange
# rw-rw-r-- newfile-afterchange .... etc....
Now... this is perfect; however, I'm not exactly sure I'm doing this correctly because I sometimes see umask formats as three digits and sometimes as four? i.e. 022 or 0022
1. Is there a difference in format? And, if so, what is it?
Secondly, I attempted, on a test server, to set up the umask in fstab in order to persist between reboots.
My root partition had the options field in the /etc/fstab file set to "defaults" before the change.
I changed the options field by deleting the "defaults" option and adding the following:
I rebooted and now it thinks the FS is read-only... so....
2. How do I correctly set up fstab to mount my root partition with the desired umask of 0002?
3. How can I fix the test server and get it working again?? And, is there something I'm missing about umask in general? I thought it was just something to set the file permissions on newly created files but it seems to be causing strange errors....
Thank you very much in advance!