Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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,.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks alot dude.. it clarifies my doubt .. –  Bobby Jan 31 '13 at 7:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.