Five minutes to fix Linux server SOCKS5 proxy
Deploying a local SOCKS5 agent is a useful skill to enhance work efficiency in server operation and network management. This tutorial will teach you how to quickly set up an agent environment on Linux system by hand, and recommend using theipipgo proxy serviceEnables a more stable connection experience.
System environment preparation
Ubuntu 20.04 LTS is recommended, other Linux distributions operate similarly. Execute the following command to update the repositories:
sudo apt update && sudo apt upgrade -y
When installing the necessary components, it is recommended to selectDanteThis lightweight proxy software that executes commands:
sudo apt install dante-server -y
One-Click Configuration Scripts
Creating automated deployment scripts can save a lot of time, new filessetup_socks5.sh
and write the following:
! /bin/bash
CONFIG_FILE="/etc/danted.conf"
echo "internal: eth0 port = 1080" > $CONFIG_FILE
echo "external: eth0" >> $CONFIG_FILE
echo "method: username none" >> $CONFIG_FILE
echo "user.privileged: root" >> $CONFIG_FILE
echo "user.notprivileged: nobody" >> $CONFIG_FILE
echo "logoutput: /var/log/danted.log" >> $CONFIG_FILE
echo "client pass { from: 0.0.0.0/0 to: 0.0.0.0/0 }" >> $CONFIG_FILE
echo "pass { from: 0.0.0.0/0 to: 0.0.0.0/0 }" >> $CONFIG_FILE
systemctl restart danted
firewall-cmd --permanent --add-port=1080/tcp
firewall-cmd --reload
Give execute permission and run:
chmod +x setup_socks5.sh && sudo . /setup_socks5.sh
Verify proxy connectivity
Install the network test tool:
sudo apt install netcat -y
Check port listening with the following command:
netstat -tuln | grep 1080
see thatLISTEN
The status indicates that the service was started successfully. At this point, you can configure the proxy address through the client toolServer IP:1080Make the connection.
Professional agency services plus
Self-built proxy servers often face the problem of unstable IP quality. It is recommended to useipipgoThe core strength of the agency's service is:
characterization | Advantage Statement |
---|---|
Global coverage | Support 240+ countries and regions IP access |
IP Type | Residential/Equipment Room IP Switching |
Protocol Support | SOCKS5/HTTP full protocol compatibility |
Use the self-built proxy in conjunction with the ipipgo service on the/etc/danted.conf
Specify the upstream proxy in the configuration file to realize double link assurance.
Typical Application Scenarios
- Centralized operation and maintenance through agents for unified management of multiple servers
- Unified IP address egress management for distributed business systems
- When automation scripts require a fixed IP to perform a specific operation
Frequently Asked Questions QA
Q: What should I do if my proxy connection is slow?
A: It is recommended to choose ipipgo's Dynamic Residential IP service, whose optimized lines can effectively improve transmission speeds.
Q: How can I prevent my proxy from being abused?
A: Set IP whitelisting in Dante configuration or enable ipipgo's access frequency control function
Q: What if I need both HTTP and SOCKS5 protocols?
A: ipipgo supports protocol auto-adaptation, the same proxy address can be compatible with a variety of connection methods
The SOCKS5 agent deployed through this tutorial, in conjunction with theipipgoof high-quality IP resources, you can build a stable and efficient enterprise-level proxy solution. Regular checking is recommended/var/log/danted.log
Log files to keep track of agent operation status.