in the unix command chmod 2770 /home/samba what does 2 stands for ?
any help is highly welcomed
hackmania
Printable View
in the unix command chmod 2770 /home/samba what does 2 stands for ?
any help is highly welcomed
hackmania
Is this the "ask all your general UN*X questions" forum or something? Perhaps you need to visit comp.os.unix.* or something...
I suggest "man chmod" or "info chmod" on your UN*X box.
well my freind...
i'm recently working and learning this wonderful OS base on UNIX ,,,so it is but obvious
that my problems will be related to it,,,,, as i 'm a a newbie so i have chosen correct sectionas
i far as i suppose,,,,
well,, if u think as senior memberthati made a mistake then i 'm sorry,,,
man chmod and info's help is very terse and unclear,, so i will be greatefu lto u friends if u can answer my question?
thanks to all reading this post
According to the man page, "the first digit selects the set user id"
If a program belongs to a certain user, or to ROOT, it cannot be
executed by non-priveliged users. If the program must perform
important priveliged tasks in the system, and yet you want
ordinary users to be able to execute it, you have a dilemma.
The set user id (suid) bit can be set for a file so that a user
can execute the priveliged program without giving the
user any extra priveliges.
:cool:
Ah, rcgreen, you are correct about the sticky bit in regards to suid programs, but hackmania specifically asked about 2770. As far as I know that is the set group bit, and only applies to directories. If you chmod a directory with the permissions 2770, then every file created in that directory will automatically have the group set to the group that owns the directory instead of the user's group, which is what it would normally be set to.
i think its in octal format.try a search on google.
str34m3r -- You're absolutly correct about the meaning of the 2 in that chmod value, but be careful what you call it. Any chmod octal value of 2000 is the set group id bit, and any chmod octal value of 4000 is the set user id bit. Both the set group id and set user id are represented by an s in the permissions report (ie: _r_s__x__x is the permission setting for /usr/bin/passwd.). The sticky bit is something else. Actually, the sticky bit isn't used much anymore, but it's represented by a t in the execute field for the world, (ie: drwxr_xr_t). Here's how O'Reilly defines it:Quote:
Ah, rcgreen, you are correct about the sticky bit in regards to suid programs, but hackmania specifically asked about 2770. As far as I know that is the set group bit, and only applies to directories. If you chmod a directory with the permissions 2770, then every file created in that directory will automatically have the group set to the group that owns the directory instead of the user's group, which is what it would normally be set to.
You can set the sticky bit with the 1000 octal value. For example, the command chmod 1777 would give you (drwxrwxrwt).Quote:
Unix directory access permissions say that if a user has write permission on a directory, she can rename or remove files there–even files that don't belong to her. Many newer versions of Unix have a way to stop that. The owner of a directory can set its sticky bit. The only people who can rename or remove any file in that directory are the file's owner, the directory's owner, and the superuser.
My apologies for using the incorrect term. I hope I didn't confuse you hackmania.