Files
2024-05-01 12:28:44 -06:00

2.6 KiB

To set up a SOCKS proxy on your Debian 12 server, you can use Dante, which is a popular and lightweight SOCKS server implementation. Here's a step-by-step guide:

  1. Update your system: Start by updating your Debian 12 server to ensure you have the latest packages:

    sudo apt update
    sudo apt upgrade
    
  2. Install Dante: Install the Dante SOCKS server package using the following command:

    sudo apt install dante-server
    
  3. Configure Dante: Open the Dante configuration file using a text editor with sudo privileges:

    sudo nano /etc/danted.conf
    

    Replace the contents of the file with the following configuration:

    logoutput: /var/log/socks.log
    internal: eth0 port = 1080
    external: eth0
    socksmethod: username
    user.privileged: root
    user.unprivileged: nobody
    user.libwrap: nobody
    client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
    }
    socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: error connect disconnect
    }
    

    This configuration sets up a SOCKS5 proxy server listening on port 1080, allows connections from any IP address, and enables username authentication.

    Adjust the configuration according to your specific requirements, such as changing the port number or adding IP restrictions.

    Save the file and exit the editor.

  4. Create a username and password: Create a username and password for accessing the SOCKS proxy by running the following command:

    sudo useradd -r -s /bin/false proxy_user
    sudo passwd proxy_user
    

    Enter and confirm a strong password when prompted.

  5. Restart Dante: Restart the Dante service to apply the new configuration:

    sudo systemctl restart danted.service
    
  6. Enable Dante to start on boot: To ensure that the Dante SOCKS server starts automatically on system boot, run the following command:

    sudo systemctl enable danted.service
    
  7. Configure Firewall: If you have a firewall enabled, make sure to open the SOCKS proxy port (1080 in this example) to allow incoming connections:

    sudo ufw allow 1080/tcp
    

    If you're using a different firewall solution, adjust the command accordingly.

Your SOCKS proxy server is now set up and running on your Debian 12 server. You can configure your applications or browsers to use the SOCKS proxy by providing the server's IP address, port (1080), and the username and password you created.

Remember to secure your SOCKS proxy by using strong authentication credentials and limiting access to trusted IP addresses if necessary.