Unix(BSD Unix, MacOSX) vs Linux login setuid bit difference

257 Views Asked by At

Under Unix (for example BSD Unix, MacOSX) the login program has the setuid bit set. In Linux login does not have the setuid bit set. The questions is about /bin/login .

What are the differences between the two architectural decisions and why Linux doesn't have to do it? How does it solve the permissions' problem?

I've seen this as a CS questions somewhere and I can't figure out the answer. So please feel free to help.

Thanks in Advance!

2

There are 2 best solutions below

1
On BEST ANSWER

In Linux you normally have a bunch of getty (text console) processes and/or a display manager (graphical) login process running with root privileges. When creating a user session, these are calling /bin/login, still with root privileges. login then drops the privileges by changing the UID/GID and execv-ing the login shell, or launching the graphical session.

1
On

Linux ist also using SUID bit for passwd. I work with Centos/Fedora and Ubuntu and all this distributions using SUID bit for passwd program.