Click to See Complete Forum and Search --> : file permissions (-r------wT) what's that mean?
Fandelem
02-02-2001, 12:16 AM
what's this mean?
-r------wT 1 root wheel 16728 Jul 28 1999 /usr/bin/finger
it won't even let me (as root) operate it ;o)
how did it get like this btw? ;o)
BloodRed
02-02-2001, 08:11 AM
-rwxrwxrwx
r = Read
w = Write
x = Execute
A "-" in front of it all means its a file, if it's a directory the "-" will be replaced by a "d". There are three sections of "rwx", they stand for, in this order:
OwnerGroupEveryone, and they signify the permissions that those three groups have for that file/dir. To change the permissions, use the chmod command:
chmod 777
This will give all three groups full rights to the file/dir(-rwxrwxrwx). In "777", each 7 indicates that the group(in order, as above) has full rights. Each right has a numerical value, which when added together, tells the system which rights you want to grant. The values are 1, 2, and 4. I can't remember now which number corresponds to each right, so I won't guess. Look at the help file or man page for "chmod", that should tell you. Hope this makes sense, and is all correct since it's from memory.
mindwarp.out
02-02-2001, 09:57 AM
Nobody has answered the mans question.. what is the "T" for?
Mindwarp
singlespeed
02-02-2001, 10:16 AM
It's explained in the info file for ls. at the prompt type info ls.
The permissions listed are similar to symbolic mode specifications
(*note Symbolic Modes::.). But `ls' combines multiple bits into
the third character of each set of permissions as follows:
`s'
If the setuid or setgid bit and the corresponding executable
bit are both set.
`S'
If the setuid or setgid bit is set but the corresponding
executable bit is not set.
`t'
If the sticky bit and the other-executable bit are both set.
`T'
If the sticky bit is set but the other-executable bit is not
set.
`x'
If the executable bit is set and none of the above apply.
did that help? :)
skweegie
02-02-2001, 10:33 AM
"t" or "T" means that the directory Sticky bit is on...
basically, this will give the rename and remove permissions of any file in that directory to the fileowner, the directory owner, and the superuser (in this order). so, for a simple example, in a multiuser shared directory where many users have rw permissions, those users can't delete other user's files, etc...
to get a perm scheme like that, (no comment on "that", i'll let craig come in and flame you) :), you'd have to do something crazy like:
chmod u=r,og-rwx,o+w,a+t /usr/bin/finger
(since finger already exists with a set defult permission of 755)
i'm not going to comment on umask, though, because i doubt you changed your umask (i hope) since finger already exists at default and you didn't have to regenerate that file...
[ 02 February 2001: Message edited by: skweegie ]
StanLin
02-03-2001, 11:21 AM
What is "sticky bit" or why is a bit sticky? Or stick to what? Or what stick what? Pardon for the sarcasm but I really don't understand it.
X_console
02-03-2001, 03:15 PM
/tmp has permissions drwxrwxrwt so therefore it's sticky. Why? We know anyone can read/delete/write/execute files on /tmp.
If you decided to put a file "myfile" in /tmp it would work. If you wanted to delete it, it would work too. But what if Joe decided to delete it? Although he has read/delete/write/execute access to /tmp, he can't, because of the sticky bit. The sticky bit allows anyone to create files in the directory, but only allows the creator to modify/delete the files. Get it?
If you create a directory /test with permissions rwxrwxrwx (no sticky), anyone can create a file there. If you create a file, Joe will be able to delete it, because the directory is not sticky. So the sticky bit is a form of security to prevent others from deleting your files, but allowing others to create their own files in the same directory.
Originally posted by BloodRed:
-rwxrwxrwx
r = Read
w = Write
x = Execute
A "-" in front of it all means its a file, if it's a directory the "-" will be replaced by a "d". There are three sections of "rwx", they stand for, in this order:
OwnerGroupEveryone, and they signify the permissions that those three groups have for that file/dir. To change the permissions, use the chmod command:
chmod 777
This will give all three groups full rights to the file/dir(-rwxrwxrwx). In "777", each 7 indicates that the group(in order, as above) has full rights. Each right has a numerical value, which when added together, tells the system which rights you want to grant. The values are 1, 2, and 4. I can't remember now which number corresponds to each right, so I won't guess. Look at the help file or man page for "chmod", that should tell you. Hope this makes sense, and is all correct since it's from memory.
Just to add some info about the values of 1, 2, 4:
4 = read
2 = write
1 = execute
Add them up for each user's permission. The permissions on a file are in this order:
owner,group,world
Like I said before, the sum of the values determines the permission for a user. Thus, if you had a file called foobar, and wanted the owner to be able to read, write, and execute, but only wanted execute capability for group and world, you'd type this:
chmod 711 foobar
HTH