Install socks5 proxy with freeradius ubuntu server

Summary: This guide will show you how to set up a SOCKS proxy server using Dante-server. You will be able to authenticate the users through free-radius.


1. Update your server

apt-get update

2. Check if gcc is install in your server

 apt-get install gcc

3. Install Dante-Server

apt-get install dante-server

4. Check version of Dante-server

dio:~# danted -v
danted: dante v1.1.19

Hopefully you don’t have any issue in the above installation steps if you have all the dependencies installed.

Now we are going to set up the pam radius module for authentication and authorization.

5. Install through apt-get

sudo apt-get install libpam-radius-auth

6. That was pretty painless. Now let’s configure it.  First, let’s tell pam_radius which radius server to talk to:

Find the file in your server

find / -iname ‘’

Mind is /lib/security/

7. Create a file called “sockd” and enter these 2 lines into it:

auth sufficient /lib/security/

account sufficient /lib/security/

8. cp sockd /etc/pam.d/ && cd /etc/

9. create a file with the name of sockd.conf

vim sockd.conf

logoutput: stderr

internal: eth0 port = 1080
internal: port = 1080
external: eth0

method: pam
user.privileged    : root
user.notprivileged : sockd

client pass {
from: to:
log: error # connect disconnect
pass {
from: to:
protocol: tcp udp
log: error # connect disconnect


10. vim /etc/pam_radius_auth.conf

Note that the file says to copy it to /etc/raddb/server, but DO NOT do that.

Edit the line “other-server    other-secret       3”  replacing ‘other-server’ with IP address radius server if you have one set up and change ‘other-secret’ the shared secret for this freeradius-server.

11. Add user for sock services to run

useradd sockd

passwd sockd

Check the socks5 is running and working fine.

ssh -N -D localhost
your password: ******************************

12. Add port 1080 to iptables otherwise your proxy server will denied your request.

iptables -A INPUT -p tcp –dport 1080 -j ACCEPT

Now you are good to go and test the socks5 through your browser.

Open your browser and click on options.

Click on Advanced and then click on Network tab.

Click on Setting button and select the radio button “Manual proxy configuration”

Enter your proxy socks server ip address and port number in the SOCKS HOST.

Select the radio button sock5 and click on ok.

open and check your ipaddress it will be showing the server ip address.

Enjoy safe browsing.

Leave a Reply

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