Linux File Permissions
Вставка
- Опубліковано 1 жов 2024
- File permissions in Unix and Linux are wonky af. We'll break down exactly how those pesky drwxrwxrwx strings work.
Learn back-end development - www.boot.dev
Learn Shells and Terminals - www.boot.dev/l...
I'm watching a bootdev video after a long time, looks like a huge upgrade. Good editor and writing. GG.
Welcome back! glad you're enjoying. We're going to be making a lot more now that we've found a style we like
0:34 The most common is 'd' or '-', more are possible take a look under "/dev". There is also 'c' (character device), 'b' (block device), 'l' (symlink), 'p' (named pipe [mkfifo command creates this]; eza shows this as '|' [pipe symbol]), 's' (socket; e.g. `nc -lU socket.sock`).
The 'x' for user/group can be an 's' (setuid/setgid) or 'S' (same but missing execute permission), for other it can be 't' (sticky bit) or 'T' (missing execute) (see /tmp).
chmod also takes numeric permissions (octal): rwx = r(4) w(2) x(1) in "ugo" (user, group, other) order, so 750 is user = rwx, group = r-x, other = ---. There can also be a four-digit permission, /tmp is 1777 = rwx for user, group, and other plus the sticky bit (that position can also be setuid(4), setgid(2), and sticky(1)).
Good point! We just showed the simple options
Short and clean, thanks!
Stass is the GOAT
Look at this man claiming first on his own video
@@remirth_bergström rekt nerd
stop bullying the viewers lane...
woah...howcome this wagslane looks so different from Backend Banter wagslane? are they the different peepo?
What about access control list?
On Linux, pretty much the same just allows you to set different permissions for different users/groups. e.g. `setfacl -m u:otherusername:rw somefile` (gives rw to otherusername, use "g:groupname" for groups).
@@ChananOren yeah. It was pretty useful when I had to mount /var/log directory in log aggregator pod but didn't want to run the pod with root privilege. I spin up the init container with root access that sets right acls.