Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


SOCKS5 proxy server setup?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

SOCKS5 proxy server setup?

I can't find any guide online for some reason.. How does one setup Socks5 proxy with authentication on debian/ubuntu server? Do I need to install some daemon that does the job, or is the functionality already integrated in the Linux OS?

My intention is to allow a remote client use this socks5 proxy with authentication.

Comments

  • miaumiau Member
    edited January 2017

    In a way, ssh is a socks5 proxy with auth.

    I dont know what keyword did you use but guide to set up socks with auth is everywhere on internet.
    https://www.google.com/search?q=dante+set+up+socks5+auth&ie=utf-8&oe=utf-8

    Another less convoluted way is to use shadowsocks with user management.

  • @stefeman I used http://tech.tiq.cc/2012/06/how-to-set-up-danted-dante-server-socks-proxy-on-linuxdebian-with-authentication/ though am having trouble finding browsers and apps that support auth for SOCKS.

  • hzrhzr Member

    user123 said: though am having trouble finding browsers and apps that support auth for SOCKS.

    Have privoxy handle auth, then listen on localhost:something as a proxy itself

  • Thanks for the answers :) I'll manage to setup something with these guides now.

  • usually i use squid proxy . then i can auth user and passwd .

  • I've seen that some bittorrent client can handle a socks proxy. In that case which socks server would redirect an open port to the client?

  • apt-get install gcc make build-essentials || yum install make gcc
    mkdir /tmp/proxy
    cd /tmp/proxy
    curl -s https://f.static.or.at/st/3proxy-0.7.1.1.tgz >3proxy-0.7.1.1.tgz
    tar -xvzf 3proxy-0.7.1.1.tgz
    rm 3proxy-0.7.1.1.tgz
    cd 3proxy
    make -s -f Makefile.Linux
    cd src
    mkdir /etc/3proxy/
    mv 3proxy /etc/3proxy/
    cd /etc/3proxy/
    
    cat << 'EOF' >/etc/3proxy/3proxy.cfg
    nserver 8.8.8.8
    nserver 8.8.4.4
    nscache 300
    daemon
    users $/etc/3proxy/proxyauth
    auth strong
    flush
    allow user1,user2
    maxconn 1024
    socks -p1234
    EOF
    
    cat << 'EOF' >/etc/3proxy/proxyauth
    user1:CL:password21
    user2:CL:password22
    EOF
    
    cat << 'EOF' >>/etc/rc.local
    /etc/3proxy/3proxy /etc/3proxy/3proxy.cfg
    EOF
    
    /etc/3proxy/3proxy /etc/3proxy/3proxy.cfg
    
    Thanked by 1flex
  • @William said:

    > apt-get install gcc make build-essentials || yum install make gcc
    > mkdir /tmp/proxy
    > cd /tmp/proxy
    > curl -s https://f.static.or.at/st/3proxy-0.7.1.1.tgz >3proxy-0.7.1.1.tgz
    > tar -xvzf 3proxy-0.7.1.1.tgz
    > rm 3proxy-0.7.1.1.tgz
    > cd 3proxy
    > make -s -f Makefile.Linux
    > cd src
    > mkdir /etc/3proxy/
    > mv 3proxy /etc/3proxy/
    > cd /etc/3proxy/
    > 
    > cat << 'EOF' >/etc/3proxy/3proxy.cfg
    > nserver 8.8.8.8
    > nserver 8.8.4.4
    > nscache 300
    > daemon
    > users $/etc/3proxy/proxyauth
    > auth strong
    > flush
    > allow user1,user2
    > maxconn 1024
    > socks -p1234
    > EOF
    > 
    > cat << 'EOF' >/etc/3proxy/proxyauth
    > user1:CL:password21
    > user2:CL:password22
    > EOF
    > 
    > cat << 'EOF' >>/etc/rc.local
    > /etc/3proxy/3proxy /etc/3proxy/3proxy.cfg
    > EOF
    > 
    > /etc/3proxy/3proxy /etc/3proxy/3proxy.cfg
    > 

    Why is cloudflare so lenient to you?

    BTW : THanx for the code

  • thagoatthagoat Member
    edited January 2017

    Once again, Shadowsocks.
    1. Pip install shadowsocks
    2. Edit config file with password.
    3. sudo ssserver -c /path/to/config.json -d start
    4. Profit.
    Example config.json:
    { "server":"0.0.0.0", "server_port":8388, "local_address": "127.0.0.1", "local_port":1080, "password":"password", "timeout":300, "method":"aes-256-cfb", "fast_open": false }

  • redalertroxredalertrox Member
    edited January 2017

    There is also an auto install script for danted server google it.

  • noaman said: Why is cloudflare so lenient to you?

    My ISP has not many customers and excellent IP reputation; i rarely see any captchas at all from CF. I do get the JS check at times though and pay for that luxury with CF not having a POP here routing me back to NL/DE.

  • stefemanstefeman Member
    edited January 2017

    I tried this and installed the libev-debian.sh method.

    Congratulations, Shadowsocks-libev install completed!
    Your Server IP:  193.70.xx.xx
    Your Server Port:  1080
    Your Password:  xxxxxxxx
    Your Local IP:  127.0.0.1
    Your Local Port:  1080
    Your Encryption Method:  aes-256-cfb
    
    Welcome to visit:https://teddysun.com/358.html
    Enjoy it!
    
    root@ip65:~/shadowsocks_install# /etc/init.d/shadowsocks start
    Shadowsocks-libev (pid 21144) is already running...
    root@ip65:~/shadowsocks_install#
    

    However, the issue is that when I try to input it to firefox for example, it does not connect at all =/

    Same with my utorrent application.

    I have no idea what the username is supposed to be, so I went with root:shadowsockspassword

  • GamerTech24GamerTech24 Member
    edited January 2017

    CentOS 6 Instructions

    yum install epel-release
    yum install wget htop nano tmux nload
    yum update
    yum upgrade
    reboot
    yum install system-config-firewall-tui dbus-python dbus
    service messagebus start
    system-config-firewall-tui
    tab over the the "[*] Enabled" and press your spacebar so the * is gone from the [ ] and then press okay
    then

    Download the latest source rpm from sourceforge.net

    wget http://downloads.sourceforge.net/ss5/ss5-3.8.9-6.src.rpm

    Build the source rpm
    This requires the rpmbuild tool provided by rpm-build package. Also, ss5 requires openldap-devel, pam-devel and openssl-devel development packages. Install these packages using YUM package manager:

    For 32 bit Linux,
    yum install gcc rpm-build openldap-devel pam-devel openssl-devel -y
    For 64 bit Linux,
    yum install gcc.x86_64 rpm-build.x86_64 openldap-devel.x86_64 pam-devel.x86_64 openssl-devel.x86_64 -y

    Now build ss5 source rpm to create the binary rpm package:
    rpmbuild --rebuild ss5-3.8.9-6.src.rpm

    Install SS5 rpm package
    On CentOS 5.x, the RPM package will be created in /usr/src/redhat/RPMS/. On CentOS 6.x, RPM package will we created in the subdirectory rpmbuild/RPMS/ of build directory. You can install the RPM package using following command:
    On CentOS 5,
    rpm -ivh /usr/src/redhat/RPMS/x86_64/ss5-3.8.9-6.x86_64.rpm (for 64 bit Linux)
    rpm -ivh /usr/src/redhat/RPMS/i386/ss5-3.8.9-6.i386.rpm (for 32 bit Linux)
    On CentOS 6,
    rpm -ivh rpmbuild/RPMS/x86_64/ss5-3.8.9-6.x86_64.rpm (for 64 bit Linux)
    rpm -ivh rpmbuild/RPMS/x86_64/ss5-3.8.9-6.i386.rpm (for 32 bit Linux)

    Run SS5 as root and change the port to 8899 (default port is 1080)
    Edit /etc/init.d/ss5 and put following lines at the top after shabang(#!/bin/sh):
    export SS5_SOCKS_PORT=8899
    export SS5_SOCKS_USER=root

    You can use any available port you want. Make sure that the port is opened in the server firewall, if any.
    5. User/password authentication
    SS5 configuration file is /etc/opt/ss5/ss5.conf. The ‘auth’ directive sets the authentication policy.

    For no authentication,
    auth 0.0.0.0/0 - -
    For user/pass authentication,
    auth 0.0.0.0/0 - u

    The user/password pairs are stored in /etc/opt/ss5/ss5.passwd. Make sure that this file is readable only by root:
    chown root.root /etc/opt/ss5/ss5.passwd
    chmod 750 /etc/opt/ss5/ss5.passwd

    In /etc/opt/ss5/ss5.passwd, put user and password separated by a space and one user/password per line.
    E.g.
    user1 pass1
    user2 pass2
    6. Set permission
    Allow all hosts to connect:

    permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - -

    1. Start ss5
      service ss5 start

    If you see an error message like the following,
    Can’t create pid file /var/run/ss5/ss5.pid
    Can’t unlink pid file /var/run/ss5/ss5.pid
    create the directory /var/run/ss5 and start ss5 again.
    That’s all.

  • stefemanstefeman Member
    edited January 2017

    I'd rather use shadowsocks on debian to keep it ultra simple. However I could use help with the above issue. Thanks everyone so far.

    Do I need to set net.ipv4.ip_forward = 1 after running the auto-install script?

  • sharknodsharknod Member
    edited January 2017

    @stefeman said:
    I'd rather use shadowsocks on debian to keep it ultra simple. However I could use help with the above issue. Thanks everyone so far.

    Do I need to set net.ipv4.ip_forward = 1 after running the auto-install script?

    Shadowsocks needs a client application to work. If you just need to use the proxy you don't have to set up forwarding.

  • miaumiau Member
    edited January 2017

    @stefeman said:

    Do I need to set net.ipv4.ip_forward = 1 after running the auto-install script?

    No. It is only required if you are routing at the IP level, such as VPN. Shadowsocks is not a VPN.

    As said above, have you set up the shadowsocks client as well? More importantly, do you understand the difference between shadowsocks and the 'standard' socks?

  • sharknodsharknod Member
    edited January 2017

    @sharknod said:

    @stefeman said:
    I'd rather use shadowsocks on debian to keep it ultra simple. However I could use help with the above issue. Thanks everyone so far.

    Do I need to set net.ipv4.ip_forward = 1 after running the auto-install script?

    Shadowsocks needs a client application to work. If you just need to use the proxy you don't have to set up forwarding.

    And then make your bowser's proxy 127.0.0.1:1080 and it should work.

    I'll try to find a English GUI picture for you.

    Download here:https://github.com/shadowsocks/shadowsocks-windows/releases

  • palme34palme34 Member

    @stefeman Which one do you use?

Sign In or Register to comment.