Skip to content

FaridZelli/ShadowsocksQuickDeployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌍 Shadowsocks Quick Deployment

Get shadowsocks-rust up and running on your server in less than 60 seconds.

β“˜ This script must be run as root.

curl -o ~/shadowsocks_deploy.sh https://raw.githubusercontent.com/FaridZelli/ShadowsocksQuickDeployment/refs/heads/main/shadowsocks_deploy.sh && chmod a+x ~/shadowsocks_deploy.sh && ~/shadowsocks_deploy.sh ; rm -f ~/shadowsocks_deploy.sh

Run the script with the -u parameter to uninstall.

πŸ“ What does this script do?

  1. Fetches the latest Shadowsocks release for your hardware
  2. Installs Shadowsocks as a service and provides an optimized default environment for ssserver

πŸ’‘ Features

  • System architecture and C Library detection
  • SSH hardening
  • Network optimization via sysctl
  • Service unit as non-root user
  • Interactive Shadowsocks configuration
  • Password generation

🐧 Supported Distributions

While this script has only been tested on Ubuntu 24.04, it should work on most Ubuntu/Debian-based distros.

πŸ§‘β€πŸ’» Raspberry Pi Passwall2 Gateway

To setup Shadowsocks on your home network, you'll need:

There are generally two ways to approach this:

Modem-Router <---> Pi
β“˜ Simple, half-bandwidth, no dongle required
(tap or click to expand)

  1. Install the latest OpenWrt release on your Raspberry Pi using Raspberry Pi Imager
  • If you're on Linux, resize the root filesystem:
# Identify the block device and partition number; e.g. /dev/sdxN
lsblk

# Resize the root partition
cfdisk /dev/sdx

# Update the filesystem
e2fsck -f /dev/sdxN
resize2fs /dev/sdxN
  1. Directly connect to your Pi using an ethernet cable and login to LuCI at 192.168.1.1
  2. Configure the LAN Interface to obtain an IP Address from the primary router
  • Network > Interfaces > Lan > Edit > Choose "Static Address"
  • Change the device to "eth0"
  • Set a valid static IPv4 address and your router's IP as the gateway / DNS
  1. Apply changes and connect the Pi to your router
  • If OpenWrt's repositories are blocked, switch to a mirror via:
  • System > Software > Configure opkg
  1. SSH into your Pi as root using the static IP address:
  1. Run the following commands:

Replace netcologne with your desired mirror

read release arch << EOF
$(. /etc/openwrt_release ; echo ${DISTRIB_RELEASE%.*} $DISTRIB_ARCH)
EOF
for feed in passwall_packages passwall_luci passwall2; do
echo "src/gz $feed https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/releases/packages-$release/$arch/$feed" >> /etc/opkg/customfeeds.conf
done
wget -O passwall.pub https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/passwall.pub && opkg-key add passwall.pub
opkg update && opkg remove dnsmasq && opkg install dnsmasq-full kmod-nft-tproxy kmod-nft-socket luci-app-passwall2
  1. Reboot your Pi, configure Shadowsocks and DoH via Services > Passwall2
  2. Configure the Raspberry Pi as the default gateway and LAN DNS provider on your router

Modem-Router > Pi > Router
β“˜ More flexible, full-bandwidth, harder to setup
(tap or click to expand)

Note: You'll need a USB 3.0 to gigabit ethernet adapter
AX88179 adapters such as the TP-Link UE306 are known to work well

  1. Install the latest OpenWrt release on your Raspberry Pi using Raspberry Pi Imager
  • If you're on Linux, resize the root filesystem:
# Identify the block device and partition number; e.g. /dev/sdxN
lsblk

# Resize the root partition
cfdisk /dev/sdx

# Update the filesystem
e2fsck -f /dev/sdxN
resize2fs /dev/sdxN
  1. Directly connect to your Pi using an ethernet cable and login to LuCI at 192.168.1.1
  2. Configure the LAN Interface to obtain an IP Address from the modem-router
  • Network > Interfaces > Lan > Edit > Choose "Static Address"
  • Change the device to "eth0"
  • Set a valid static IPv4 address and your modem-router's IP as the gateway / DNS
  1. Apply changes and connect the Pi to your modem-router
  • If OpenWrt's repositories are blocked, switch to a mirror via:
  • System > Software > Configure opkg
  1. SSH into your Pi as root using the static IP address:
  1. Run the following commands:

Replace netcologne with your desired mirror

read release arch << EOF
$(. /etc/openwrt_release ; echo ${DISTRIB_RELEASE%.*} $DISTRIB_ARCH)
EOF
for feed in passwall_packages passwall_luci passwall2; do
echo "src/gz $feed https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/releases/packages-$release/$arch/$feed" >> /etc/opkg/customfeeds.conf
done
wget -O passwall.pub https://netcologne.dl.sourceforge.net/project/openwrt-passwall-build/passwall.pub && opkg-key add passwall.pub
opkg update && opkg remove dnsmasq && opkg install dnsmasq-full kmod-nft-tproxy kmod-nft-socket luci-app-passwall2
  • Install the appropiate kernel module for your ethernet adapter
  • For example:
opkg install kmod-usb-net-asix-ax88179
  1. Reboot your Pi, configure Shadowsocks and DoH via Services > Passwall2
  2. Head back over to Network > Interfaces and create a new interface:
  • Name: wan
  • Device: eth0
  • Type: DHCP Client
  1. Verify that everything is detected and working properly. Now, it's time to make the switch:
  • Change the "lan" interface device from "eth0" to "eth1", while leaving the gateway blank
  • Change the "wan" interface device from "eth1" to "eth0"

If you've done everything correctly, you should be able to save and apply the changes without any warnings

  1. Connect the ethernet adapter to your router

About

Fast, no-nonsense Shadowsocks Rust installer 🌍

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages