pinkie pie

mendel


Rich Lafferty's Journal

(mendelicious mendelusions)


Previous Entry Share Next Entry
Why don't Unix users use symbolic permissions anymore?
thinking, perplexed
mendel
Watching junior to intermediate level sysadmins on a handful of Unix-related IRC channels, I've noticed that no-one seems to use symbolic permissions with "chmod" anymore. This sort of puzzles me, because symbolic permissions are the only way to change some permissions without setting all of them at once. So, I ask of you:

Poll #517957 Symbolic permissions

When you use unix's "chmod" command to set read, write or execute permissions, you primarily use:

symbolic permissions (u=rwx,a=rx)
15(39.5%)
numeric permissions (755)
23(60.5%)

When you use unix's "chmod" command to set setuid, setgid, and sticky bits, you primarily use:

symbolic permissions (u+s,+t)
19(54.3%)
numeric permissions (6755)
16(45.7%)

I'd love to hear your thoughts on why you, or the people I see on IRC, use one or the other. Me, I tend to use numeric for straightforward file permissions (755, 644, 700, 600) and symbolic for anything that isn't those four, and always symbolic for setting sticky bits and setuidness.

  • 1
I do it the same way you do, but when I am dictating a command over the phone to someone relatively inexperienced and I want them to setuid/setgid, I use numeric permissions.

Oh -- and if I don't know/care about the current permissions of a file and only want to add/subtract world read or execute, I use symbolic, because it's quicker.

So, I use numeric permissions when I want to clobber everything and symbolic permissions when I only want to tweak. But what do I know, I'm not a sysadmin anymore ;)

o/~ Welcome to the hotel ucb o/~

I'm not a sysadmin anymore ;)

Can't fool me!

I use symbolic permissions often, but mostly for stuff dealing with all perms, like "chmod a+rx foo". I almost never use "-". For all other cases, numerical.

I don't think I've ever used numeric permissions except when copying and pasting something someone else has written.

I know it's "only" binary arithmetic, but I always find it much faster to type exactly what I want than to figure out what the hell number I'm supposed to type in. As I'm not a full-time sysadmin, this applies even to things like 644 and 755, which I should know in my brain/fingers without thinking, but don't.

It depends on what I'm doing. If I run into a bunch of things and I think, "I need to make these readable for the web," I type:

chmod 0644 foo

Same for making them executable:

chmod 0755 foo

If I have a bunch of things that just need one bit toggled either way, I tend to type something like:

chmod a+r foo

I never use the sticky bit letter form, I never remember it. I tend to never set uid/gid/sticky anyway.

I don't know the symbolic ones, though I've heard of them. They typically don't occur to me.

But then, I'm rarely in the situation where I want to add or subtract some bits to a number of files, regardless of their previous permissions.

I use setuid and setgid rarely, but when I do, they're together, and typically on a file with permission 6711, so I just use that number.

But then, I'm not a sysadmin.

I've always used symbolic. I can't remember that stupid numbers bullshit!

I probably use numeric all the time (and seriously all the time — I'd have to look up the syntax for symbolic if I wanted to use it) simply because I'm always setting permissions, never tweaking. If I wanted to remove execute or read for certain groups, for example, it might be different.

I've never learned symbolic permissions, nor do I know what the extra bits (sticky, etc.) are or how to set them.

Typically, I'm making things either readable or executable: only recently have I started using permissions in ways to limit access to various parts of the system (with the purchase of a hosted server and starting to host other people there, I've needed to learn how to set things up so people can't mess up their permissions, make things more public than they should be, and then yell at me.)

I have to second your exception. I primarily use numbers (755, 644, 700, 600) for individual files and wildcards within a single directory. My brain is wired for that to be faster than trying to remember "ygo" is yourself, group, others, etc. I save the "go+w" type stuff when I'm doing something recursively, and even then I don't always use it. For instance, if I want to tag directories as being executable, I'll just use the -exec argument to "find" and number codes.

Because I never use the extra (sticky) bits recursively, I was not even aware of +s and +t!

Wow, that's a point I didn't think about. I wonder how the numbers-only types do recursive chmod? I shudder to think of what the replacement for capital-X would look like.

I always use numbers, but that's primarily because I only use chmod one time per system that I admin, and it looks like this:

chmod -R 7777 /

Can I have an account on your system?

Sure -- the root password is "p4ssw0rd".

I tend to do numbers for mass files , as there's only a few varations that I really use.

If I am tinkering with an indiviual file I will use symbolic, mainly because it's easier/quicker than figuring out the appropriate number.

I typically use numbers for individual files, because there are really only a few that you need to know - 644, 775, etc.

I use letters for setuid, setgid, and sticky because I do that stuff so rarely I don't remember the numbers.

For recursive find, it would depend on what I was doing.

(Deleted comment)
I think it's actually more complicated behavior than you're giving it credit for. For instance, the vast majority of the time when you want to set permissions, you're setting something to 0755 or 0644. So people tend to type those, because they've seen them a million times, and it seems like the shortest path from A to B. At the same time, you don't have to figure out what the current permissions are, and you don't have to type a lot. But if you just want to, say, remove 01, then it's generally much easier to do "o-x" than to think about which bit is which.

I only ever do chmod in WS_FTP, which has checkboxes. I associate numbers with what I have to do to certain files because script instructions say so. :P

answer: pure dumb habit, in my case

I don't spend so much time setting sticky bits and such, so I wind up looking those up and wind up coming up with numbers. Plain old permissions stuff, I can just remember the symbolic ones.

So, I guess I'm you backwards. :-)

(Deleted comment)
I've been doing Unix professionally since 1987, and I still don't know the numbers off hand. So unless I'm copying some install instruction that says "chmod 0644 foo.sh", I'll do a "chmod a+x foo.sh" or "chmod go-w myfile". Hell, I don't even remember that there is an "=" option or you can combine things (although I do remember +s and +t) so sometimes I'll end up doing several chmods on one file to get it the way I want.

  • 1
?

Log in

No account? Create an account