Browse Source

Upload files to ''

master
cse47126 3 years ago
parent
commit
140c0a55f2
  1. 13
      3masterLocal.sh
  2. 6
      3worker.sh
  3. 13
      3workerRemote.sh
  4. 1
      connect.sh
  5. 6
      create-user.sh

13
3masterLocal.sh

@ -0,0 +1,13 @@
sudo apt update
sudo apt upgrade -y
# Installing a terminal browser
sudo apt-get install lynx -y
# Finding out the worker1IP
network=$(ifconfig | grep inet | sed -n 1p | awk "{print \$2}" | cut -f 1-3 -d "." | sed 's/$/.*/')
worker1IP=$(nmap -sP $network | grep worker_1 | awk '{print $NF}' | tr -d '()')
# Local Forwarding
#connecting via ssh to worker1 and asking to forward
#the service (apache) from his 80 port to master's 5000 port
ssh docker@$worker1IP -L 5000:$worker1IP:80
#after that if we login to master node in a NEW TAB and lynx localhost:5000
#we' ll see the worker's1 service accessible inside the master node

6
3worker.sh

@ -0,0 +1,6 @@
sudo apt update
sudo apt upgrade -y
sudo apt-get install apache2 -y
sudo apt-get install lynx -y
sudo service apache2 start

13
3workerRemote.sh

@ -0,0 +1,13 @@
sudo apt update
sudo apt upgrade -y
# Installing a terminal browser
sudo apt-get install lynx -y
# Finding out the masterIP
network=$(ifconfig | grep inet | sed -n 1p | awk "{print \$2}" | cut -f 1-3 -d "." | sed 's/$/.*/')
masterIP=$(nmap -sP $network | grep master | awk '{print $NF}' | tr -d '()')
# Giving access to the remote host (master node)via an ssh connection
#(docker@172.19.0.2) to a service running in our (worker's 1) port 80
#and forwarding it to the remote's host (master node) port 5002
ssh -R 5002:localhost:80 docker@$masterIP
#now if we lynx localhost:5002 inside the master node
#we' ll see the worker's1 service accessible inside the master node

1
connect.sh

@ -0,0 +1 @@
sudo openvpn --config Athina.ovpn

6
create-user.sh

@ -0,0 +1,6 @@
USERNAME=Athina
vpn_data=$PWD/openvpn-services/
docker=registry.vlabs.uniwa.gr:5080/myownvpn
docker run -v $vpn_data:/etc/openvpn --rm -it $docker easyrsa build-client-full $USERNAME nopass
docker run -v $vpn_data:/etc/openvpn --log-driver=none --rm $docker ovpn_getclient $USERNAME > $USERNAME.ovpn
Loading…
Cancel
Save