環境

  • Headless server: Raspberry Pi, Ubuntu 20.04
  • Client: Windows 10, Firefox

 

安裝

安裝squid,用作proxy server

# update repo
sudo apt-get update

# install squid
sudo apt-get install squid -y

# open port 3128 if useing UFW
sudo ufw allow 3128

 

設置

在Firefox裡設置好proxy

setting

 

使用

安裝完squid並設置好firefox proxy後,便可使用ssh tunnel將網頁流量由ubuntu送到windows。

開啟ssh client並使用-CNT2gL選項

ssh -CNT2gL 8080:localhost:3128 username@headless-server -p 22

現在firefox已經連上ubuntu server, 能夠使用其網絡去瀏覽網頁

 

測試

  1. headless server 連上vpn
  2. 設置好並開啟squid
  3. 檢查ip是否為vpn ip, 或是否能連上公司/學校的內聯網

 

其他

  • squid settings: /etc/squid/squid.conf

    • http_access
    • http_port
  • squid status: sudo systemctl status squid.service

 

Reference

  1. https://askubuntu.com/questions/603100/gui-browser-on-a-headless-server
  2. https://phoenixnap.com/kb/setup-install-squid-proxy-server-ubuntu
  3. https://www.cyberciti.biz/faq/ubuntu-squid-proxy-server-installation-configuration/
如果你覺得我的文章對你有幫助的話,歡迎關注本博客或者關注我的 Github