简体   繁体   中英

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

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!

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM