向文件添加 setuid 权限

2 setuid permissions chmod

我在 CentOS 5 服务器上托管了一个 php 应用程序。该应用程序通过名为 openmgr 的 ssh 文件运行一些命令。为此,我想授予-rwsr-xr-x该文件的权限。

我试过了chmod +x openmgr,但这只是-rwxr-xr-x允许。如何rwsr为文件添加?

Man*_*nde 5

rws是,部分表示setuid该文件权限设置。它允许用户以其所有者的特权和权限运行/执行文件。

为了启用setuid对问题中提到的文件的权限,您应该运行:

chmod 4755 openmgr

或者

chmod u+s openmgr