How to setup a Socks5 Proxy server on Ubuntu with Dante

By | March 12, 2017

Dante Socks5 Server

Dante is a socks5 server that you can use to setup a socks5 proxy on your ubuntu or debian machine. In this quick tutorial we shall learn how to setup dante and use authentication.

With authentication enabled, the dante proxy server would require all clients to provide login details in order to use the proxy server. This is a good idea.

Installing Dante on Ubuntu

The default Ubuntu repositories have the dante-server package but it is outdated. The version present is 1.1.19 which is quite old and also has some bugs. The authentication feature does not work properly.

If you don't need authentication then you can install it.

sudo apt-get install dante-server

The version in repository was

# danted -v
danted: dante v1.1.19

Like said earlier, the authentication feature does not properly work with it. The log file shows the following error messages -

Mar 11 14:05:05 (1489241105) danted[5020]: pass(1): tcp/accept ]: username%[email protected] -> system username/password failed

Trying to test with curl shows the following error message -

$ curl -v -x socks5://username:[email protected]:1080
*   Trying
* User was rejected by the SOCKS5 server (1 1).
* Closing connection 0
curl: (7) User was rejected by the SOCKS5 server (1 1).

Some users have reported similar issues at this reddit post -

So we need to install a newer version. There is a ppa for dante-server at -

but it is no longer being maintained. But we can use the deb file from the ppa to install dante on Ubuntu 16.10

The download url is this -
# wget

Install using gdebi command

$ sudo apt-get install gdebi-core
$ sudo gdebi dante-server_1.4.1-1_amd64.deb


The next task is to configure the dante server before starting it. The configuration file can be found here -

nano /etc/danted.conf

The contents should look similar to this -

# /etc/danted.conf

logoutput: syslog
user.privileged: root
user.unprivileged: nobody

# The listening network interface or address.
internal: port=1080

# The proxying network interface or address.
external: eth0

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
socksmethod: username

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none

client pass {
        from: to:
        log: connect disconnect error

socks pass {
        from: to:
        log: connect disconnect error

Now start the danted proxy server

# service danted start

Use the netstat command to check the port number

# netstat -nlpt | grep dant
tcp        0      0  *               LISTEN      6342/danted

Create a User

Dante can use the system unix user accounts to authenticate the connecting clients. For this you should create a separate user. Any client that will be connecting to this proxy server will be sending the password in plain text over the network, so beware of that.

$ adduser mike

Test with curl

Once you have setup everything, its time to test that the proxy server is working as expected. Use the curl command to do this. Specify the username, password, server ip and port number and try fetching some url.

curl -v -x socks5://mike:[email protected]<PROXY_IP>:1080

If everything goes fine, you should see the html of in the terminal. Now you can use the proxy inside of browsers.


Config documentation can be found here -

If you want to compile the latest version of dante from source then check out these links -

Last Updated On : 12th March 2017

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *