Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • CLI
  • Multimedia
  • Plugins
  • Windows
  • Contact

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN
  • Incus

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid
  • ssh

Socks SSH forward internet and DNS
https://datawookie.dev/blog/2023/12/ssh-tunnel-dynamic-port-forwarding/

# local
ssh -R 1080 user@remote

# remote
export http_proxy=socks5h://localhost:1080
export https_proxy=socks5h://localhost:1080
# export HTTPS_PROXY=socks5://localhost:1080/

#echo "nameserver 127.0.0.1" > /etc/resolv.conf

cat < /etc/apt/apt.conf.d/12proxy
Acquire::http::Proxy "socks5h://localhost:1080";
Acquire::https::Proxy "socks5h://localhost:1080";
EOF

cat <> /etc/environment
#export http_proxy=socks5h://localhost:1080
#export https_proxy=socks5h://localhost:1080
export all_proxy=socks5h://localhost:1080
EOF


# Configurte scks5h proxy in Docker
mkdir /etc/systemd/system/docker.service.d
cat < /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=socks5h://127.0.0.1:1080"
Environment="HTTPS_PROXY=socks5h://127.0.0.1:1080"
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker docker.service


# python
sudo apt install -y python3-socks

# git
git config --global http.proxy 'socks5h://127.0.0.1:1080'


# SSH config
Host my-remote
    HostName my_server.com
    RemoteForward 1080
    ServerAliveInterval 60
    ServerAliveCountMax 3


or optional
# dns2socks
# http(s) / socks export
# https://lib.rs/install/dns2socks
https://gist.github.com/yougg/5d2b3353fc5e197a0917aae0b3287d64

# dns2socks
wget https://github.com/tun2proxy/dns2socks/releases/download/v0.2.0/dns2socks-x86_64-unknown-linux-gnu.zip
dns2socks --socks5-settings socks5://localhost:1080 --force-tcp