This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computing:remote-upgrades [2020/01/21 05:01] – oemb1905 | computing:remote-upgrades [2020/01/27 20:42] (current) – oemb1905 | ||
|---|---|---|---|
| Line 47: | Line 47: | ||
| username ALL=(root) NOPASSWD: / | username ALL=(root) NOPASSWD: / | ||
| | | ||
| - | 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 |
| sudo touch / | sudo touch / | ||
| Line 56: | Line 56: | ||
| In the file that opens, use the following script parameters or something similar. | In the file that opens, use the following script parameters or something similar. | ||
| | | ||
| - | hostsa=" | ||
| - | #run on each host | ||
| - | for i in $hostsa; | ||
| - | do | ||
| - | echo "I will now update" | ||
| - | 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 | ||
| - | | + | |
| - | sudo openvpn hostname.mooo.com.ovpn & | + | #run on each host |
| - | sleep 10s | + | for i in $hosts; |
| - | hostsa="10.44.44.19 | + | |
| - | for i in $hostsa; | + | |
| do | do | ||
| echo "I will now update" | echo "I will now update" | ||
| - | ssh -t -p 59999 targetuser@$i sudo apt-remote; | + | |
| + | ssh -t $i screen -S aptremotescreen | ||
| done; | done; | ||
| - | cd ~ | ||
| - | sudo killall openvpn | ||
| - | sleep 10s | ||
| - | These configs an be found on the haackingclub | + | If you would prefer to do these types of backups with a vpn connection (instead of port forwarding), |
| + | |||
| + | Option 1 - Using vpn connection, connect from localhost to remote host/server with ssh and screen, and then execute a script | ||
| + | |||
| + | Use this script on your localhost: [[https:// | ||
| + | Use this script on the remote host that you are backing up: [[https:// | ||
| + | |||
| + | 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/ | + | Use this script on your localhost: |
| | | ||
| - | --- // | + | --- // |