While Virtual Private Networks (VPNs) are popular for securing online activities, many users still prefer the speed and efficiency of SOCKS proxies, particularly for managing torrent traffic. This article explores how to set up a robust and lightweight SOCKS5 proxy server on your Linux system using MicroSocks.
IPv4 and IPv6 Support: MicroSocks seamlessly supports both IPv4 and IPv6 addressing, ensuring compatibility with modern networks.DNS Support: It handles DNS requests, ensuring smooth resolution of domain names.TCP-Based: MicroSocks currently relies on TCP for network proxying, providing a reliable and well-established protocol.Flexible Authentication: You can connect to MicroSocks with or without a password, or even use a one-time password. The flexibility eliminates the need for configuration file manipulation.
sudo apt install microsocks
sudo pacman -S microsocks
Install development tools: sudo apt update && sudo apt install build-essential
Download and extract MicroSocks: wget http://ftp.barfooze.de/pub/sabotage/tarballs/microsocks-1.0.4.tar.xz tar -xvf microsocks-1.0.4.tar.xz && cd microsocks*/
Compile and install: make && sudo make install
-1: Enables one-time authentication, adding your IP address to a whitelist. Subsequent connections from this IP will not require authentication.-q: Disables logging.-i ip-address: Specifies the IP address to listen on. If omitted, MicroSocks listens on all network interfaces (default: "0.0.0.0").-p port: Sets the listening port (default: "1080").-u user and-P password: Specify the username and password for authentication in plain text. These can be any combination and are independent of existing user accounts on your system.
microsocks -1 -p 8484 -u proxyuser -P securepassword
curl --socks5 user:password@server-ip:port https://www.google.com/
Open Firefox and go to "Preferences". Select "General". Scroll down to "Network Settings" and click "Settings". Choose "Manual proxy configuration". Select "SOCKS v5". Enter the host and port of your MicroSocks server.
Go to "Settings". Navigate to "Network" and then "Proxy". Enable "Network Proxy" and select "Manual" configuration. Enter the host and port of your MicroSocks server in the "SOCKS5 HOST" section.
Check your firewall status: sudo ufw status
If UFW is active, open the port (remember, we used port 8484 in our example): sudo ufw allow 8484/tcp
Create a Systemd service file: sudo nano /etc/systemd/system/microsocks.service
Paste the following configuration (adjust the "/usr/bin/microsocks" path if you installed MicroSocks from source): [Unit] Description=microsocks SOCKS5 server Documentation=https://github.com/rofl0r/microsocks After=network.target auditd.service [Service] EnvironmentFile=/etc/microsocks.conf ExecStart=/usr/bin/microsocks -1 -u ${MICROSOCKS_LOGIN} -P ${MICROSOCKS_PASSW} [Install] WantedBy=multi-user.target
Save and close the file. Create a MicroSocks configuration file for the username and password: sudo nano /etc/microsocks.conf
Paste the following (replace the user and password with your MicroSocks details): # used by the systemd service file MICROSOCKS_LOGIN="proxy-user" MICROSOCKS_PASSW="proxy-password"
Save and close the file. Enable and start the service: sudo systemctl enable --now microsocks.service
Verify the service status: systemctl status microsocks
Debian, Ubuntu, etc.: sudo apt remove microsocks
Arch Linux, Manjaro, etc.: sudo pacman -R microsocks
sudo rm /usr/local/bin/microsocks
sudo systemctl disable --now microsocks.service
sudo rm /etc/microsocks.conf
Find the port's index number: sudo ufw status numbered
Delete the corresponding port: sudo ufw delete [no]
0 comments:
Post a Comment