unix - why normal User can't change password of others if suid bit is set on passwd -


as per suid concept, if suid bit set on file/executable file , normal user execute command. command executed privilege of owner of file/command.

suid bit set on "passwd" command , root owner of passwd. if normal user "user1" execute command 'passwd' executed root privilege. however, can change password not others. why so?

suid bit doesn't make run root. merely allows make setuid system call, elevate it's privileges.

passwd requires root privileges update user credentials. quite cautiously though - starts in user context, verifies stuff, , escalates privileges make system change. being set setuid doesn't have bearing on - merely allows this.

if want accomplish non-root password changing should use sudo run passwd root.

if want, write own command embeds setuid system call, sudo better approach.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -