blog posts

Setting up SOCKS proxy on a VPS with Dante

This tutorial will teach you how to set up a quick SOCKS proxy on any VPS. For this guide we will be using Debian 7.0 Minimal as it’s one of the lightest Linux distributions, which will make sure you get the most out of your resources on your VPS to have a smooth proxy even on small budget VPS services. We will be using a more permanent solution with Dante, rather than using an SSH command.

Please follow the highlighted code; you should be able to just copy and paste all of the code and have a working SOCKS proxy, however, we’ve also added instructions for learning purposes.

[STEP 1]
Connect via SSH to the VPS running the proxy server. Make sure you have your apt packages update and a text editor such as nano installed first:

apt-get update && apt-get upgrade
apt-get install nano

[STEP 2]
Once you have ran both of those commands, you’ll be able to run the following command to get the actual proxy server on your VPS.

apt-get install dante-server

[STEP 3]
The previous step might take some time, but once it’s done, you’ll have to configure the server, this is where nano comes in.

rm -f /etc/danted.conf
nano /etc/danted.conf

[STEP 4]
When inside the file, you will see nothing, just a white bar at the top saying:
GNU nano 2.2.6 File: /etc/danted.conf
Paste this into the file(if using putty, paste is simply right clicking the terminal)

logoutput: /var/log/socks.log
internal: venet0:0 port = 1080
internal: 127.0.0.1 port = 180
external: venet0:0
method: username #rfc931
clientmethod: none
user.privileged: root
user.notprivileged: nobody
user.libwrap: nobody
client pass {
        from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
        log: connect disconnect error
}
pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        command: bind connect udpassociate
        log: error # connect disconnect iooperation
        method: username
}

[STEP 4]
Once that is done, you’ll be able to start your proxy server by running the following command:

service danted restart

[STEP 5]
To ensure that the server is running, you can run the following, if you get no return, please check the guide and see what step you missed or check your configuration. Another way to check is the logs, the log for the proxy server is located in /var/log/socks.log.

netstat -tulnp | grep 1080

You should see a result similar to this if it’s running:

tcp 0 0 x.x.x.x:1080 0.0.0.0:* LISTEN 18395/danted

Leave a Reply

Your email address will not be published.