Setup Socks5 proxy using Dante on Ubuntu
This guide will take you through the steps to install and configure Dante on Ubuntu or any Debian dased linux destro.
1. Install Dante Server
sudo apt -y install dante-server
To check the version of Dante Server currently installed:
danted -v
2. Setup daemons
chmod +x /etc/init.d/dantedupdate-rc.d danted defaults
3. Configure the service
mv /etc/danted.conf /etc/danted.conf.bakecho "logoutput: /var/log/danted.log
internal: eth0 port = 1080
external: eth0
clientmethod: none
socksmethod: username
user.privileged: root
user.notprivileged: nobodyclient pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error connect disconnect
}
client block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bind connect udpassociate
log: error connect disconnect
socksmethod: username
}
socks block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
" > /etc/danted.conf
The service is set to use port 1080. If you want to use a different port, you can change it in the above config file.
4. Create proxy user
useradd soksproxy --shell /usr/sbin/nologin
passwd soksproxy
We have added a user named soksproxy that will be used to connect and login. The user name can also be changed if required.
The passwd command has been used to set the user password. Do not forget to set this else your proxy service will be open to the world.
5. Start Dante service
Now your proxy service is ready to use. You just need to start it.
systemctl enable dantedsystemctl start danted
*Optional: Setup UFW firewall
If using UFW as your firewall, you need to allow the proxy service port.
ufw default allow outgoing
ufw allow 1080
ufw reload
You can test the proxy by running below commands:
curl -x socks5://soksproxy:password@server_ip:1080 ifconfig.co
OR
ssh -N -D 1080 soksuser@server_ip
👍