【问题标题】:"./ngrok authtoken <my_authtoken>" not working“./ngrok authtoken <my_authtoken>”不工作
【发布时间】:2023-03-20 09:25:01
【问题描述】:

我从 microsoft store 获得了 kali linux。

我想运行./ngrok authtoken &lt;my_authtoken&gt;

但得到-bash: ./ngrok: cannot execute binary file: Exec format error

所以我尝试了chmod +x ./ngrok authtoken &lt;my_authtoken&gt;sudo chmod +x ./ngrok authtoken &lt;my_authtoken&gt;

但无论哪种方式我都会得到chmod: cannot access 'authtoken': No such file or directory chmod: cannot access '&lt;my_authtoken&gt;'

我该怎么办? 我真的需要运行./ngrok authtoken &lt;my_authtoken&gt;

P.S:我想使用 blackeye,当我选择它下载 Ngrok 的号码时

编辑 1:我从 https://ngrok.com/download 下载了另一个版本,我删除了 blackeye 目录中以前的 Ngrok 并解压缩了新版本。 现在我收到bash: ./ngrok: Permission denied

编辑 2:已经 12 天没有准确的答案了,我想我必须得到真正的 Kali Linux,问题是 Windows 版本。

【问题讨论】:

    标签: ngrok kali-linux


    【解决方案1】:

    在发布问题之前始终使用 Google 并尝试找到答案。

    您的第一个错误 (-bash: ./ngrok: cannot execute binary file: Exec format error) 可能是因为您尝试运行针对不同架构(例如 x86 或 ARM)制作的程序(请参阅 https://askubuntu.com/a/648558)。

    您的第二个错误 (chmod: cannot access 'authtoken': No such file or directory chmod: cannot access '&lt;my_authtoken&gt;') 是因为您尝试从 chmod 中运行命令,您必须先 chmod 文件然后运行它。

    您的第三个错误 (bash: ./ngrok: Permission denied) 是因为您需要先将文件 chmod 为可执行文件,然后才能运行它,并且不需要 sudo,除非 chmod 返回 chmod: cannot access '&lt;yourfile&gt;': Permission denied,那么您应该使用 sudo。

    你应该运行的是:

    curl -L https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -o ngrok.zip
    unzip ngrok.zip
    chmod +x ngrok
    ./ngrok authtoken <myauthtoken>
    

    【讨论】:

    • 谢谢,但它不起作用仍然给我“-bash:./ngrok:无法执行二进制文件:执行格式错误”,我已经搜索过,但就像你回答的那样,他们没有工作,就像我之前说的那样,我知道这不是我需要的版本,所以我下载了其他版本,但仍然不是那个版本。请仔细阅读问题。
    • 旁注:如果为 Nvidia Jetson 构建,请使用 ARM 版本的 Ngrok :-)