banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

免费调用互联网上 DeepSeek‑R1 模型

第一步:下载并安装#

从 ChatBox 官网下载适合你操作系统的客户端版本并安装。
https://chatboxai.app/en
配置 API 接口
在 ChatBox 的设置中,将 API 地址配置为目标机器的地址,例如:

image

第二步:通过 FOFA 查询开放的 Ollama 接口#

FOFA 是一款强大的网络空间搜索引擎,能够帮助我们筛选出全球范围内公开暴露的服务。对于部署了 Ollama 的机器来说,只要其服务配置不当(例如绑定到 0.0.0.0 且防火墙规则松散),就可能被 FOFA 搜索到。

https://en.fofa.info/

image

第三步:在 ChatBox 的设置中,将 API 地址配置为目标机器的地址#

image

image

记得保存。
然后可以愉快的使用了。

第四:#

如何防止自己的本地部署被别人远程利用#

如果你在本地部署了 Ollama 模型服务,但又不希望被别人随意访问(即 “被白嫖”),可以参考以下几种安全措施,并按照新手步骤操作:

4.1 限制监听地址#

操作步骤(以 Linux 为例):#

  1. 查找配置文件

    • 找到 Ollama 服务的配置文件(例如 /etc/ollama/config.conf),查找类似 bind_address = 0.0.0.0 的设置。
  2. 修改绑定地址

    • 将绑定地址修改为 127.0.0.1,例如:
      bind_address = 127.0.0.1
      port = 11434
      
  3. 保存并重启服务

    • 保存配置文件后,运行:
      sudo systemctl restart ollama
      
    • 这样,服务只在本机上监听,外部无法直接访问。

4.2 配置防火墙规则#

Windows 环境:#

  1. 打开 “控制面板” → “系统和安全” → “Windows Defender 防火墙”,点击 “高级设置”。
  2. 创建一个新的入站规则,选择 “端口”,指定 TCP 和端口号 11434。
  3. 选择 “允许连接”,在 “远程 IP 地址” 中仅添加你信任的内网 IP 段(如 192.168.1.0/24)。
  4. 保存规则后,其它 IP 的访问请求将被拒绝。

Linux 环境(以 ufw 为例):#

  1. 启用 ufw:
    sudo ufw enable
    
  2. 允许局域网内 IP 访问:
    sudo ufw allow from 192.168.1.0/24 to any port 11434
    
  3. 如果默认策略不是拒绝,可以添加拒绝规则:
    sudo ufw deny 11434
    
  4. 查看规则确认:
    sudo ufw status verbose
    

4.3 启用认证和访问控制#

如果服务必须对外开放,可以在应用层加上身份验证:

基于 Node.js/Express 的简单认证:#

  • 使用 basic-auth 模块,在代码中添加认证中间件,只有输入正确用户名和密码的用户才能访问服务。

Web 服务器(Apache/Nginx)配置基本认证:#

  • 利用 htpasswd 工具生成密码文件,然后在 Apache 的 .htaccess 或 Nginx 配置中启用基本认证。
加载中...
此文章数据所有权由区块链加密技术和智能合约保障仅归创作者所有。