Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个 Shell 脚本,这个 shell 脚本应该: 1. 创建另一个 shell 脚本 2. 将新脚本的 suid 位设置为 root 用户 3. 以当前用户身份运行这个新脚本
我们可以这样做吗?任何人都可以提供任何想法或一些代码片段?
This will not work under many versions of unix (or linux). The setuid bit on shell scripts is typically ignored, since it is far too easy to subvert such a program.