Linux - GeneralThis 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
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.
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.
When setting permissions for a filesystem to be mounted in fstab why do you have to use 4 numbers in the umask. ex: umask 0000. I know what the last 000 do, they give wrx permission to the owner, group and other but what is that first number for. Maybe someone can explain quickly to me what it's for. Thanks!
First number is for the setuid, setgid, and the sticky bit. Example:
You know the last numbers work like this:
4=r,2=w,1=x. 'rwx'=7, 'rw-'=6, 'r--'=4. Thus you have the three numbers, '777', which means 'rwxrwxrwx'.
The first digit is similar, I think it goes like this; 4=setuid, 2=setgid, 1=sticky bit
setuid: if this is enabled, then the program is run as the same user as the user who owns the file
setgid: if this is enabled, then the program is run as the group that owns the file
sticky bit: cache this file in the swap, not used for what it was meant for anymore, sometimes used for other things
For example, if regular users needed to run a program as root: the setuid would be enabled on the program file, and the program would be owned by root. Then the program can be run as root by anyone.
The sticky bit is something old. It once ws meant for caching files in the swap. For example, if a program had the sticky bit enabled, the kernel would keep it in swap, supposedly for faster access. It doesn't do this anymore, and the sticky bit is ignored on files. On folders, however, it has a completely different function that still works (search it).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.