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 配置中啟用基本認證。
載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。