46 lines
1.4 KiB
Bash
46 lines
1.4 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# update yum
|
|
sudo yum update -y
|
|
|
|
# install and enable squid proxy
|
|
# install httpd-tools so we can use htpasswd when setting up authentication
|
|
sudo yum -y install squid
|
|
sudo yum -y install httpd-tools
|
|
|
|
# copy the proxy auth config file
|
|
cp ./configs/squid-proxy-basic-auth.conf /etc/squid/squid.conf
|
|
|
|
proxy_username="admin"
|
|
proxy_password="ballsofsteel"
|
|
|
|
# create htpasswd user
|
|
htpasswd -b -c /etc/squid/passwd $proxy_username $proxy_password
|
|
|
|
sudo systemctl start squid
|
|
sudo systemctl enable squid
|
|
sudo systemctl status squid
|
|
|
|
# give us ifconfig and vim
|
|
sudo yum install net-tools vim -y
|
|
|
|
ip_address=$(ip address show | grep 'inet ' | sed -e 's/^.*inet //' -e 's/\/.*$//' | tail -1)
|
|
port='3128'
|
|
|
|
cat << SQUID
|
|
^ Proxy Info:
|
|
/ \ ---------------------------------
|
|
\ / http info: http://$ip_address:$port
|
|
| | ---------------------------------
|
|
| | Username: $proxy_username
|
|
| 0 | Password: $proxy_password
|
|
// ||\\ ---------------------------------
|
|
(( // ||
|
|
\\)) \\
|
|
//|| ))
|
|
( )) //
|
|
// ((
|
|
|
|
|
|
SQUID
|
|
|