我想使用下面的命令来允许使用libpcap软件包,而不用sudo(在debian系统上):
sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/nodejs
我得到这个错误:
Failed to set capabilities on file `/usr/bin/nodejs' (Invalid argument) The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
但是/usr/bin/nodejs
不是符号链接:
-rwxr-xr-x 1 root root 18M Jun 3 03:20 /usr/bin/nodejs USER@HOST:~$ which nodejs /usr/bin/nodejs
我的驱动器是这样安装的:
USER@HOST:~$ cat /etc/fstab # # /etc/fstab # # <device> <mountpoint> <filesystemtype> <options> <dump> <fsckorder> /dev/mmcblk0p1 / ext3 defaults 0 1
检查顺序:
/usr/bin/nodejs
是否是一个文件。 /usr/bin/nodejs
的分区被挂载rw。 nosuid
挂载,这将阻止文件系统上的某些操作(nosuid挂载选项指定文件系统不能包含set userid文件)。