【问题标题】:NetfilterQueue tiped "are you root " ,which I was already the "root"NetfilterQueue 提示“你是 root”,而我已经是“root”
【发布时间】:2016-10-25 04:51:16
【问题描述】:

成功导入netfilterqueue后,在执行NetfilterQueue()时遇到错误 nfqueue = NetfilterQueue() File "netfilterqueue.pyx", line 153, in netfilterqueue.NetfilterQueue.__cinit__ (netfilterqueue.c:3733) OSError: Failed to bind family 2. Are you root? 我的环境如下:

  • Ubuntu 16.04 x86_64
  • Python 2.7.11(Canopy)

问题:

  1. 'netfilterqueue.pyx'可能在这里:git link,我该如何解决?

  2. 如果我不是 root,当我在 python 命令行中时,我应该如何获得“root”访问权限?

【问题讨论】:

    标签: python-2.7 root ubuntu-16.04 canopy netfilter


    【解决方案1】:

    在执行代码之前尝试以 root 身份执行 python 解释器

    sudo python
    >>> import netfilterqueue
    >>> nfqueue = NetfilterQueue()
    

    【讨论】:

      猜你喜欢
      • 2015-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-25
      • 2018-12-29
      • 1970-01-01
      • 2019-09-30
      • 1970-01-01
      相关资源
      最近更新 更多