1

I'm new to unix , i have tried to find the difference between permissions of execute permission and special permissions . For instance , the "su" command has the permissions

-rws-r-xr-x

Under that permissions an user can execute that command as a root .

i have changed to

-rwx-r-xr-x 

using chmod command, under this permissions also i can execute the command . what is the difference between those two permissions,.

1 Answer 1

3

The two are not mutually exclusive. The letter s here means "is executable and has the 'setuid' bit". (If the file had only 'setuid' but was not executable, you would see an upper-case S instead.)

The 'setuid' bit is used, as you noted, for allowing users to execute command as root (more precisely, as the command's owner, but root is the most common one). It is usually set on those programs that need access to root-only functions.

In this case, /bin/su needs root access to switch user accounts. If you remove the 'setuid' bit, you can still execute the program, but it will not work as intended, since it 1) cannot check the other user's password so you'll always get "Authentication failure", 2) cannot switch to the other user's account, so nobody can use su root anymore.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .