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.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
SOCKS5 Proxy on Ubuntu 16.04
jamespeach
Member
in Help
I know there are a million tutorials out there, however every one is entirely different, and I have spent two hours trying to get any of them to work.
I am wanting a SOCKS5 proxy on a Ubuntu server. It needs to have a username and password authentication, and it needs to allow all IP address to have access to connect to the server, obviously with a correct username and password first. If anyone knows of an easy tutorial that will work for what I need, or knows how to do it yourself, it would be greatly appreciated. Thanks
Comments
I usually use this shadowsocks script:
install:
wget --no-check-certificate -O shadowsocks-all.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh chmod +x shadowsocks-all.sh ./shadowsocks-all.sh 2>&1 | tee shadowsocks-all.log
uninstall:
./shadowsocks-all.sh uninstall
shadowsocks is not a SOCKS5 server.
Install all the necessary tools to compile source code with: apt-get install build-essential -y.
Download the latest 3proxy source code with: cd /tmp && wget https://github.com/z3APA3A/3proxy/archive/0.8.9.tar.gz --no-check-certificate.
Extract the source code of 3proxy with: cd /tmp && tar xvzf 0.8.9.tar.gz.
Compile the 3proxy source code with: cd /tmp/3proxy-0.8.9 && make -f Makefile.Linux.
Move the compiled 3proxy binary to executables folder with: cd /tmp/3proxy-0.8.9/src && mv 3proxy /usr/bin.
Set correct permission for 3proxy executable file with: chmod +x /usr/bin/3proxy
Create a empty file called 3proxy.cfg in your home directory or wherever you basically like. Open it with a text editor of your choice like nano, vim or similar.
Paste the following configuration code into it:
daemon
nserver 8.8.8.8
nserver 8.8.4.4
nscache 65536
users proxy:CL:3pr0xychangeme
log /var/log/3proxy/3proxy.log D
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
rotate 30
auth strong
external 0.0.0.0
internal 0.0.0.0
auth strong
flush
allow proxy
maxconn 384
socks -p1080
Change "proxy" in "users proxy:CL:3pr0xychangeme" to the username you want to use. Also change "3pr0xychangeme" in "users proxy:CL:3pr0xychangeme" to the password you want to use. Additionally change the "proxy" in "allow proxy" to the username you set when editing "users proxy:CL:3pr0xychangeme". This will whitelist the user you want for login/authentication. If you feel like using another port than 1080 you can change it in "socks -p1080".
Save the file and close your text editor. Before you can launch the SOCKS5 3proxy server you have to create the logging folder or else it won't start. Use the following command to do that: mkdir /var/log/3proxy.
Now you can start the 3proxy server with: /usr/bin/3proxy /path/to/3proxy.cfg.
It will work in the background as a daemon and stay active even after you closed your SSH session. If you want to start it up automatically on reboot simply add "/usr/bin/3proxy /path/to/3proxy.cfg" to your /etc/rc.local file.
To kill the 3proxy process you have to figure out its PID with ps ax | grep 3proxy and then use kill -9 pid to kill it.
Used resources for this guide: https://github.com/hidden-refuge/3proxy (a handy script I found while actually checking out a Squid installer repo posted here some weeks ago).
Here is a tutorial for Shadowsocks in English: https://www.vpndada.com/how-to-setup-shadowsocks-server-on-amazon-ec2/
Here is a tutorial for Shadowsocks in Chinese: https://tenach.github.io/post/ss-server-on-vultr/