User Tools

Site Tools


computing:remote-upgrades

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:remote-upgrades [2020/01/21 05:01] oemb1905computing:remote-upgrades [2020/01/27 20:42] (current) oemb1905
Line 47: Line 47:
   username ALL=(root) NOPASSWD: /usr/local/bin/apt-remote   username ALL=(root) NOPASSWD: /usr/local/bin/apt-remote
      
-Now you are ready to create the script on the primary workstation that will pass the apt-remote script to the target workstations:+Now you are ready to create the script on the primary workstation (localhost) that will pass the apt-remote script to the target workstations:
  
   sudo touch /usr/local/bin/apt-remote-update.sh   sudo touch /usr/local/bin/apt-remote-update.sh
Line 56: Line 56:
 In the file that opens, use the following script parameters or something similar.  This script runs on the primary workstation and then executes the "sudo apt-remote" script on the target machine.  Again, none of this will work if your ssh is improperly configured.  In the file that opens, use the following script parameters or something similar.  This script runs on the primary workstation and then executes the "sudo apt-remote" script on the target machine.  Again, none of this will work if your ssh is improperly configured. 
      
-hostsa="haackremote.mooo.com lthsf.mooo.com" 
-#run on each host 
-for i in $hostsa; 
-do 
-  echo "I will now update" $i; 
-  ssh -t -p 60000 $i sudo apt-remote; 
-done; 
- 
-And here is how I adjusted the primary workstation script to do this with a remote host that requires an openvpn connection to be established first: 
- 
   #!/bin/bash   #!/bin/bash
-  cd /home/wsuser/zion/client-recs/client/vpn-client-name +  hosts="server.com 10.55.55.9" 
-  sudo openvpn hostname.mooo.com.ovpn & +  #run on each host 
-  sleep 10s +  for i in $hosts;
-  hostsa="10.44.44.19 10.44.44.85+
-  for i in $hostsa;+
   do   do
     echo "I will now update" $i;     echo "I will now update" $i;
-    ssh -t -p 59999 targetuser@$i sudo apt-remote;+    #ssh -t $i sudo apt-remote; 
 +    ssh -t $i screen -S aptremotescreen sudo apt-remote;
   done;   done;
-  cd ~ 
-  sudo killall openvpn 
-  sleep 10s 
  
-These configs an be found on the haackingclub gitlab repository over here +If you would prefer to do these types of backups with a vpn connection (instead of port forwarding), then use something like these configurations below. 
 + 
 +Option 1 - Using vpn connection, connect from localhost to remote host/server with ssh and screen, and then execute a script on the server that uses rsync over ssh to send its backup to target backup host on its LAN: 
 + 
 +Use this script on your localhost: [[https://repo.haacksnetworking.com/oemb1905/haackingclub/blob/master/backups/option1/localhost.sh|localhost.sh]] 
 +Use this script on the remote host that you are backing up: [[https://repo.haacksnetworking.com/oemb1905/haackingclub/blob/master/backups/option1/remote.sh|remote.sh]] 
 + 
 +Option 2 - Using vpn connection, connect from localhost to remote host/server with ssh and screen, and then execute a script on the server that uses rsync over ssh to send its backup back to you at localhost:
  
-  * [[https://codetalkers.services/oemb1905/haackingclub/|Haacking Club]]+Use this script on your localhost: [[https://repo.haacksnetworking.com/oemb1905/haackingclub/blob/master/backups/option2/localhost.sh|localhost.sh]]
      
- --- //[[jonathan@haacksnetworking.com|oemb1905]] 2020/01/20 21:59//+ --- //[[jonathan@haacksnetworking.com|oemb1905]] 2020/01/27 13:18//
computing/remote-upgrades.1579582868.txt.gz · Last modified: 2020/01/21 05:01 by oemb1905