1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How tomake socks5 Proxy on your Centos VPS

Discussion in 'Proxies' started by gorb86, Apr 17, 2015.

  1. gorb86

    gorb86 Newbie

    Joined:
    Feb 5, 2015
    Messages:
    11
    Likes Received:
    0
    Don't write # before code :)
    And remove * in first code

    1. Download the latest source rpm from sourceforge.net

    Code:
    [B]#wget http:*//downloads.sourceforge.*net/ss5/ss5-3.8.9-6.src.rpm[/B]
    2. 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,
    Code:
    [B]#[/B][B]yum install gcc rpm-build openldap-devel pam-devel openssl-devel -y[/B]
    For 64 bit Linux,
    Code:
    [B]#[/B][B]yum install gcc.x86_64 rpm-build.x86_64 openldap-devel.x86_64 pam-devel.x86_64 openssl-devel.x86_64 libgssapi-devel.x86_64[/B][B] -y[/B]
    Now build ss5 source rpm to create the binary rpm package:
    Code:
    [B]#[/B][B]rpmbuild --rebuild ss5-3.8.9-6.src.rpm[/B]
    3. 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,
    Code:
    [B]#[/B][B]rpm -ivh /usr/src/redhat/RPMS/x86_64/ss5-3.8.9-6.x86_64.rpm[/B]
    (for 64 bit Linux)

    Code:
    [B]#[/B][B]rpm -ivh /usr/src/redhat/RPMS/i386/ss5-3.8.9-6.i386.rpm
    [/B]
    (for 32 bit Linux)

    On CentOS 6,
    Code:
    [B]#[/B][B]rpm -ivh rpmbuild/RPMS/x86_64/ss5-3.8.9-6.x86_64.rpm[/B]
    (for 64 bit Linux)

    Code:
    [B]#[/B][B]rpm -ivh rpmbuild/RPMS/x86_64/ss5-3.8.9-6.i386.rpm[/B] 
    (for 32 bit Linux)

    4. 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):

    *Install nano:
    Code:
    [B]#yum install -y nano [/B]
    Code:
    [B]#nano [/B][B]/etc/init.d/ss5[/B]
    [B]export SS5_SOCKS_PORT=8899
    export SS5_SOCKS_USER=root[/B]
    (commands in nano: Ctrl+o -> Enter? SAVE, Ctrl+x -> Enter? EXIT)

    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.
    Code:
    [B]#nano [/B][B]/etc/opt/ss5/ss5.conf[/B]
    For no authentication,
    Code:
    [B]auth 0.0.0.0/0 [/B]
    - -

    For user/pass authentication,
    Code:
    [B]auth 0.0.0.0/0 - u[/B]
    The user/password pairs are stored in /etc/opt/ss5/ss5.passwd. Make sure that this file is readable only by root:
    Code:
    [B]#[/B][B]chown root.root /etc/opt/ss5/ss5.passwd[/B]
    [B]#[/B][B]chmod 750 /etc/opt/ss5/ss5.passwd[/B]
    In /etc/opt/ss5/ss5.passwd, put user and password separated by a space and one user/password per line.
    E.g.
    Code:
    [B]#nano [/B][B]/etc/opt/ss5/ss5.passwd[/B]
    [B]user1 pass1[/B]
    [B]user2 pass2[/B]
    6. Set permission (/etc/opt/ss5/ss5.conf)

    Allow all hosts to connect:
    Code:
    [B]#nano [/B][B]/etc/opt/ss5/ss5.conf[/B]
    [B]permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - -[/B]
    7. Shutdown firewall
    Code:
    [B]# service iptables save
    # service iptables stop
    # chkconfig iptables off[/B]
    [B]# service ip6tables save
    # service ip6tables stop
    # chkconfig ip6tables off[/B]

    8. Start ss5 (/etc/opt/ss5/ss5.conf)

    Code:
    [B]#[/B][B]service ss5 start[/B]
    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.
     
  2. gorb86

    gorb86 Newbie

    Joined:
    Feb 5, 2015
    Messages:
    11
    Likes Received:
    0
    Sorry for an error in a thread but i can't edit a post, in step 5 must be:

    For no authentication,
    Code:
    [SIZE=3]#nano /etc/opt/ss5/ss5.conf  [/SIZE][/B][SIZE=3] 	 	[/SIZE][B][SIZE=3]auth 0.0.0.0/0 - -[/SIZE][B]
    [/B]