Monday, January 14, 2008

SETUID, SETGID bit and Sticky bit

Setuid and setgid (short for set user ID and set group ID, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable's owner or group. When a binary executable file has been given the setuid attribute, normal users on the system can execute this file and gain the privileges of the user who owns the file (commonly root) within the created process.

Setting the setgid permission on a directory (chmod g+s) causes new files and subdirectories created within it to inherit its group, rather than the primary group of the user who created the file (the owner is never affected, only the group). Newly created subdirectories inherit the setgid bit.

The following command will find you the files on your system that carry the SETUID and SETGID bit.
bash# find / -type f -perm +6000 –ls

The setuid and setguid can be set by using the chmod command
Chmod 6777 filename /directory name

When sticky bit set, it instructed the Operating system(OS) to retain the text segment of the program in swap space after the process exited. This speeded subsequent executions by allowing the kernel to make a single operation of moving the program from swap to real memory. Thus, frequently-used programs like editors would load notably faster.

The most common use of the sticky bit today is on directories, where, when set, items inside the directory can be renamed or deleted only by the item's owner, the directory's owner, or the superuser (Without the sticky bit set, a user with write and execute permissions for the directory can rename or delete any file inside, regardless of the file's owner.)

The sticky bit can be set using the chmod command and can be set using its octal mode 1000 or by its symbol t (s is already used by the setuid bit). For example, to add the bit on the directory /usr/local/tmp, one would type chmod +t /usr/local/tmp. Or, to make sure that directory has standard tmp permissions, one could also type chmod 1777 /usr/local/tmp.

Thursday, January 3, 2008

Check before use medicine

http://www.drugdigest.org/DD/Home

It is a useful site to know medicines usage, drawbacks and other details !!!

Kill -9 PID .What is 9 ?

We used to use the commad

>>kill -9 pid ..

From where -9 coming. Please check the result of the command

>>kill -l.

Wowww....It lists all signals with a corresponding digit. Please check what is meant for 9. 9 corresponds to SIGKILL .