ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

HackingTool 一键安装脚本提示 “This installer must be run as root” 怎么办

HackingTool 一键安装脚本提示 “This installer must be run as root” 怎么办 HackingTool 一键安装脚本提示 “This installer must be run as root” 怎么办【免费下载链接】hackingtoolALL IN ONE Hacking Tool For Hackers项目地址: https://gitcode.com/GitHub_Trending/ha/hackingtool运行 HackingTool 的一键安装命令后终端如果输出This installer must be run as root这不是系统故障而是安装脚本的前置权限检查脚本检测到当前用户不是 root直接退出。HackingTool 的两种安装入口——install.sh一键脚本和install.py手动安装脚本——都做了同样的检查install.sh 中通过id -u判断是否为 rootinstall.py 中通过os.geteuid() ! 0判断不满足就打印该提示并以非零状态退出不会执行任何安装动作。要求 root 是安装流程的硬性前提因为脚本会写入系统级路径Linux 下克隆仓库到/usr/share/hackingtool、创建启动器/usr/bin/hackingtoolmacOS 下对应/usr/local/share/hackingtool和/usr/local/bin/hackingtool路径定义见 constants.py。这些路径都需要 root 权限同时脚本还要用系统包管理器安装 git、python3 等依赖。解决方法用 sudo 重新运行该错误出现时没有半成品残留直接用带sudo的命令重跑即可这也是 README.md Installation 一节给出的官方命令形式。方式一一键安装install.shREADME 推荐的一键命令本身就带sudocurl -sSL https://raw.githubusercontent.com/Z4nzu/hackingtool/master/install.sh | sudo bash如果你之前执行的是去掉sudo的版本按上面这条原样重跑即可。install.sh的报错信息中也直接给出了同样的用法提示Usage: curl -sSL url | sudo bash。方式二手动安装install.py先克隆仓库再用sudo运行安装脚本git clone https://github.com/Z4nzu/hackingtool.git cd hackingtool sudo python3 install.pyinstall.py在非 root 下运行时提示面板中给出的用法同样是sudo python3 install.py。从本地克隆目录运行时脚本会检测到hackingtool.py与install.py同目录直接拷贝本地源码而不是重新克隆。重跑前必须知道的副作用确认使用 root 权限重跑前了解脚本会做什么依据 install.sh 与 install.py 的正文逻辑安装系统包自动检测包管理器install.sh 支持 apt-get / pacman / dnf / brewinstall.py 还支持 zypper / apk更新索引并安装 git、curl、python3、pip、venv 等依赖install.py 还会按发行版追加 ruby、go、php、java 等包。克隆/拷贝源码到/usr/share/hackingtoolLinux或/usr/local/share/hackingtoolmacOS。如果该目录已存在脚本会询问Replace it? [y/N]输入 y 会删除整个已有安装目录再重新安装已有重要数据时先自行备份。创建 venv 并安装 Python 依赖requirements.txt。写入启动器/usr/bin/hackingtool或/usr/local/bin/hackingtool并设置 755 权限。创建用户目录~/.hackingtool/含config.json与tools/。通过 sudo 运行时install.sh 会把该目录的属主改回执行 sudo 的普通用户SUDO_USERinstall.py 则用Path.home()创建文档注明 root 下会建在/root/.hackingtool/。验证安装是否成功安装流程走完两个脚本都会打印完成信息Installation complete! Type hackingtool to start.以上为脚本内置的结尾输出install.sh 还逐项打印Package manager、Python x.x、Cloned to ...、Launcher installed at ...、User config: ...等状态行。接着在终端输入hackingtool能进入带分类网格Information Gathering、Web Attack 等 20 个类别加 Update / Uninstall的主菜单说明启动器与运行环境都已就位。README 也明确以 Then run:hackingtool 作为安装完成后的动作。加上 sudo 后仍失败时的其他已知报错权限问题解决后安装链路还有几个文档中明确的前置检查会各自给出不同报错注意不要和 root 报错混淆找不到受支持的包管理器install.sh 直接报No supported package manager found (need apt-get, pacman, dnf, or brew)install.py 则提示No supported package manager found并列出支持范围apt-get, pacman, dnf, zypper, apk, brew。Python 版本不足要求 3.10。install.sh 报Python 3.10 required. Found: Python x.xinstall.py 与 hackingtool.py 的入口都会打印[ERROR] Python 3.10 or newer is required.并给出安装提示sudo apt install python3.10。没有网络install.py 会先探测https://github.com或https://www.google.com失败则报No internet connection并退出install.sh 的克隆步骤同样依赖网络。平台限制Windows 不受支持install.py 明确提示使用 WSL2 搭配 Kali 或 Ubuntu 镜像WSL 下能装但提示无线相关工具不可用macOS 为部分支持网络/无线工具需要 Linux且必须先装 Homebrew否则 install.py 直接退出。已经在 root 下如容器环境Docker 场景中容器内本身就是 root无需也不应再跑一遍宿主机安装脚本。README 为 Docker 用户提供了独立路径docker build -t hackingtool .构建镜像docker run -it --rm hackingtool直接运行或docker compose up -d后docker exec -it hackingtool bash进入容器Compose 会把/root/.hackingtool挂到持久卷上见 docker-compose.yml。按以上路径处理后This installer must be run as root本身不会再出现若终端输出的是上述其他报错则按对应报错的说明处理。【免费下载链接】hackingtoolALL IN ONE Hacking Tool For Hackers项目地址: https://gitcode.com/GitHub_Trending/ha/hackingtool创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表