Welcome guest, not a member yet? Registering is free and easy! Create Account  




[Bash] SPSI - Squid3 Proxy Server Installer (Ubuntu)

#1
(This post was last modified: 12-16-2016, 01:20 PM by Grey.)

SPSI
Squid3 Proxy Server Installer

[Image: squid-logo-lucky-2.gif]

# Information
This script will install Squid3 proxy server with username and password authentication on Ubuntu.



# Usage
  • Replace the following:
    • PORT_HERE = Your desired port number.
    • USERNAME_HERE = Your desired username.
    • PASSWORD_HERE = Your desired password.
  • Save the script as SPSI.
  • Run it!
    bash SPSI


# Source Code

Code:
#!/bin/bash

clear

echo "==============================================="
echo "Squid 3 Proxy Server Installer"
echo "==============================================="

IP=$(curl -s http://ident.me |cut -d " " -f 5)
PORT=PORT_HERE
USERNAME=USERNAME_HERE
PASSWORD=PASSWORD_HERE

apt-get -y update &> /dev/null
apt-get -y install apache2-utils squid3 &> /dev/null
htpasswd -b -c /etc/squid3/passwd $USERNAME $PASSWORD &> /dev/null
mv /etc/squid3/squid.conf /etc/squid3/squid.conf.sample
wget --no-check-certificate -O /etc/squid3/squid.conf http://pastebin.com/raw/cm2vSJzs &> /dev/null
echo "http_port $PORT" | cat - /etc/squid3/squid.conf > tmp && mv tmp /etc/squid3/squid.conf
cp /etc/init/squid3.conf /etc/init.d/squid3
touch /etc/squid3/blacklist.acl
service squid3 restart &> /dev/null
update-rc.d squid3 defaults &> /dev/null
iptables -I INPUT -p tcp --dport $PORT -j ACCEPT &> /dev/null
iptables-save &> /dev/null

echo "Done!"
echo "==============================================="
echo "IP       : $IP"
echo "Port     : $PORT"
echo "Username : $USERNAME"
echo "Password : $PASSWORD"
echo "==============================================="
echo "Happy Browsing! :)"
echo "==============================================="
Reply

#2

Thanks for sharing this mate Smile
Reply





Users browsing this thread:
1 Guest(s)