简体   繁体   English

Unix(BSD Unix,MacOSX)与Linux登录setuid的位差异

[英]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. 在Unix(例如BSD Unix,MacOSX)下,登录程序已设置setuid位。 In Linux login does not have the setuid bit set. 在Linux中,登录没有设置setuid位。 The questions is about /bin/login . 问题是关于/bin/login

What are the differences between the two architectural decisions and why Linux doesn't have to do it? 两种体系结构决策之间有何区别?为什么Linux不必这样做? How does it solve the permissions' problem? 如何解决权限问题?

I've seen this as a CS questions somewhere and I can't figure out the answer. 我已经将其视为某处CS的问题,但找不到答案。 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. 在Linux中,通常会有一堆getty (文本控制台)进程和/或以root权限运行的显示管理器(图形)登录进程。 When creating a user session, these are calling /bin/login , still with root privileges. 创建用户会话时,它们正在调用/bin/login ,但仍具有root特权。 login then drops the privileges by changing the UID/GID and execv -ing the login shell, or launching the graphical session. login然后通过改变UID / GID和滴剂的特权execv -ing登录壳,或启动图形会话。

Linux ist also using SUID bit for passwd. Linux ist也将SUID位用于passwd。 I work with Centos/Fedora and Ubuntu and all this distributions using SUID bit for passwd program. 我与Centos / Fedora和Ubuntu以及所有这些使用SUID位的passwd程序一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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