Setting up a **SOCKS5 proxy with authentication** involves configuring a proxy
server (like **Dante**, **Shadowsocks**, or **3proxy**) to support **username and
password** authentication. Here's a step-by-step guide using **Dante Server** on a
Linux machine:
---
## ✅ Step-by-Step Guide: SOCKS5 Proxy with Authentication (Using Dante)
### 🔧 1. **Install Dante**
On **Debian/Ubuntu**:
```bash
sudo apt update
sudo apt install dante-server
```
On **Red Hat/CentOS**:
```bash
sudo yum install dante-server
```
---
### ⚙️ 2. **Create a User for Authentication**
You’ll need a local system user that Dante will use for username/password
authentication.
```bash
sudo useradd -m proxyuser
sudo passwd proxyuser
```
You can create more users if needed.
---
### 📄 3. **Configure Dante (sockd.conf)**
Edit the config file:
```bash
sudo nano /etc/danted.conf
```
Example configuration (basic working setup):
```conf
logoutput: syslog
internal: eth0 port = 1080
external: eth0
method: username
user.notprivileged: nobody
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
command: bind connect udpassociate
}
```
**Replace `eth0`** with your actual network interface (you can find it with `ip
a`).
---
### 🔒 4. **Start the Dante Service**
```bash
sudo systemctl restart danted
sudo systemctl enable danted
```
---
### ✅ 5. **Test the Proxy**
You can test it with:
- **Proxy clients**: e.g. Proxifier (Windows), FoxyProxy (Firefox/Chrome)
- **Curl**:
```bash
curl --socks5 username:password@your_server_ip:1080 https://ifconfig.me
```
---
## Tips for Security
- Use **firewall rules** to restrict access to specific IPs.
- Make sure your users have **strong passwords**.
- You can also set up Dante with TLS or restrict ports to further enhance security.
---
Would you prefer to use **Docker** for this setup? Or are you working on a specific
OS or with a different proxy server (like 3proxy or Shadowsocks)?