From 052e04b90b3938394e75099293ba3d31542606ca Mon Sep 17 00:00:00 2001 From: "J. Patrick Fulton" Date: Thu, 24 Aug 2023 10:54:05 -0500 Subject: [PATCH 1/6] Complete notes. --- SETUP.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SETUP.md b/SETUP.md index b049e16..6222e74 100644 --- a/SETUP.md +++ b/SETUP.md @@ -7,3 +7,12 @@ cd scripts ./create-resource-group.sh personal-network northcentralus ./create-network.sh personal-network ./create-linux-server.sh -s -o personal-network vpn-server + +Install client opvn config to Tunnelblick from deployment folder + +./create-linux-server.sh -b personal-network backup-server + +Open the deployment folder +Pull the password for applebackup +Open Finder > Go to Server... > Enter Private FQDN and copied password +Open Settings > Time Machine > Add Share > Select AppleBackups share > Start Backup From f09d69bfda9a8ccdcccd1be44276d92d20390507 Mon Sep 17 00:00:00 2001 From: "J. Patrick Fulton" Date: Thu, 24 Aug 2023 11:21:06 -0500 Subject: [PATCH 2/6] Expand draft, rename file. --- SETUP.md => SETUP_BASIC_NETWORK.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) rename SETUP.md => SETUP_BASIC_NETWORK.md (51%) diff --git a/SETUP.md b/SETUP_BASIC_NETWORK.md similarity index 51% rename from SETUP.md rename to SETUP_BASIC_NETWORK.md index 6222e74..c6cbe72 100644 --- a/SETUP.md +++ b/SETUP_BASIC_NETWORK.md @@ -1,16 +1,42 @@ -# Setup +# Setup a Basic Personal Network -Follow main README. +Follow the prerequisite steps and installations from the main repository +[README](./README.md). +From the root of this repository navigate to the control scripts folder with +the command: + +```bash cd scripts +``` + +## Create and Configure a Resource Group +```bash ./create-resource-group.sh personal-network northcentralus +``` + +## Create the Virtual Network and Private DNS Zone + +```bash ./create-network.sh personal-network +``` + +## Create an OpenVPN Server + +```bash ./create-linux-server.sh -s -o personal-network vpn-server +``` Install client opvn config to Tunnelblick from deployment folder +## Create a Samba Backup Server + +```bash ./create-linux-server.sh -b personal-network backup-server +``` + +## Connect Time Machine to the Backup Server Open the deployment folder Pull the password for applebackup From 056080ab2aea58032ceecbd89e003bc8e4935023 Mon Sep 17 00:00:00 2001 From: "J. Patrick Fulton" Date: Thu, 24 Aug 2023 12:14:29 -0500 Subject: [PATCH 3/6] Draft progress. --- SETUP_BASIC_NETWORK.md | 44 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/SETUP_BASIC_NETWORK.md b/SETUP_BASIC_NETWORK.md index c6cbe72..3d6c97c 100644 --- a/SETUP_BASIC_NETWORK.md +++ b/SETUP_BASIC_NETWORK.md @@ -12,23 +12,65 @@ cd scripts ## Create and Configure a Resource Group +The following command creates a resource group to host the remaining resources +and configures the current user in the `Virtual Machine Administrator Login` role +for the resource group to allow the current user to access the virtual machines +using Azure AD credentials. + ```bash ./create-resource-group.sh personal-network northcentralus ``` ## Create the Virtual Network and Private DNS Zone +The following script creates a virtual network with an associated private +DNS zone which is configured to auto-register records for new virtual machines +that attach to the virtual network. The script will prompt for user inputs +for the name of the DNS zone and the address space for the network. In most cases, +the default values for the address space prompts will be sufficient. + ```bash ./create-network.sh personal-network ``` ## Create an OpenVPN Server +The next command creates a Linux virtual machine to run an OpenVPN server that +will create a tunnel into the virtual network. The installation will initially +be performed over an open SSH port to the public IP address associated with the +virtual machine. Once the installation is complete, the rule allowing SSH connectivity +on the public IP address for the machine is removed. An OpenVPN client configuration +file will be securely transferred to the local workstation and placed in the +deployment output folder. The output folder will be located in the current local +user's home folder and will be labeled `deployment-outputs-{UUID}`. Output lines +at the end of the script will identify this folder. + ```bash ./create-linux-server.sh -s -o personal-network vpn-server ``` -Install client opvn config to Tunnelblick from deployment folder +At this stage, the remaining steps must be performed across the VPN tunnel. To +install the client configuration file, open [Tunnelblick](https://tunnelblick.net/downloads.html) +and use the Finder to navigate to the deployment outputs folder. Drag the OVPN file found +there onto the Tunnelblick icon in the menu bar to install the file. Open the connection from +that application. + +Validate that connectivity and access to the private DNS zone is working from the terminal +by pinging the private FQDN of the newly created VPN server. + +```bash +ping vpn-server.yourprivatednszonenamehere.com +``` + +It may be necessary to clear the local workstation's DNS cache and restart the VPN connection +if errors appear from the last command related to name resolution. Use the following command +to clear the local DNS cache if this is the case. + +```bash +sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder +``` + +Only proceed to the next step if name resolution for the private dns zone is working. ## Create a Samba Backup Server From cb067226572a0e832fda7452e0671e8a3c1ed0d7 Mon Sep 17 00:00:00 2001 From: "J. Patrick Fulton" Date: Thu, 24 Aug 2023 12:23:03 -0500 Subject: [PATCH 4/6] Complete samba documentation section. --- SETUP_BASIC_NETWORK.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SETUP_BASIC_NETWORK.md b/SETUP_BASIC_NETWORK.md index 3d6c97c..4a6da52 100644 --- a/SETUP_BASIC_NETWORK.md +++ b/SETUP_BASIC_NETWORK.md @@ -74,6 +74,20 @@ Only proceed to the next step if name resolution for the private dns zone is wor ## Create a Samba Backup Server +Next, create a Linux virtual machine running Samba server with a configuration that +supports macOS Time Machine backups. This configuration will take place across the +the VPN tunnel with the following command. A data disk to store the backup data will +be created, formatted and mounted into the Linux file system in this step. + +Note that this data disk will be configured for deletion with the virtual machine be default +should you run the `/delete-vm.sh` script against the virtual machine. You may wish +to take a snapshot of the data disk prior to deleting the virtual machine should +you wish to retain and data stored there prior to removing the virtual machine. + +Randomly generated passwords for Samba share access will be securely transferred to a new deployment outputs folder in your home directory at the end of the process. The final outputs of the script +will show the name of the deployment outputs folder from this step. Note that it will have +a different name than the output folder from the previous step. + ```bash ./create-linux-server.sh -b personal-network backup-server ``` From 6013fc220eadd2a1981e82f9a5a323e52f3b2843 Mon Sep 17 00:00:00 2001 From: "J. Patrick Fulton" Date: Thu, 24 Aug 2023 12:45:20 -0500 Subject: [PATCH 5/6] Complete draft. --- SETUP_BASIC_NETWORK.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/SETUP_BASIC_NETWORK.md b/SETUP_BASIC_NETWORK.md index 4a6da52..9d9697a 100644 --- a/SETUP_BASIC_NETWORK.md +++ b/SETUP_BASIC_NETWORK.md @@ -94,7 +94,33 @@ a different name than the output folder from the previous step. ## Connect Time Machine to the Backup Server -Open the deployment folder -Pull the password for applebackup -Open Finder > Go to Server... > Enter Private FQDN and copied password -Open Settings > Time Machine > Add Share > Select AppleBackups share > Start Backup +Using the Finder, navigate to the new deployment outputs folder and in an editor +of your choice open the `samba-users.txt`. Copy the randomly generated password +associated with the `applebackup` account to the clip board. + +From the **Finder** > **Go** menu select **Connect to Server...\*** to open a server +connection dialog. Enter the Samba address of the newly created backup server: + +```bash +smb://backup-server.yourprivatednszonehere.com +``` + +Click connect. Enter `applebackup` for the username and paste the password into the +password field. Select the checkbox to retain this username and password key on your +key chain. In the next step, select the `applebackups` share as the volume to mount. +The Finder will open an show the contents of the share. It will be empty if the share +has not yet been used. + +To connect Time Machine to the remote share, open the **System Settings** application. +Select **General** > **Time Machine**. Click the **Plus** button to add a backup target. +Choose the `applebackups` share from the next dialog and click **Set Up Disk**. + +In the next dialog, ensure that you elect to encrypt your backup files with a password. +Enter a password for the backup of your choosing and confirm it prior to moving to the +next step. You will need this password in the future should you need to use these backup +files from another workstation in a recovery operation. Memorize it and store it in a safe +place. It is not added to the key chain. + +Once the disk has been set up, the backup will begin in 60 seconds. The first backup operation +is complete and may take some time. Future backup operations are incremental and significantly +faster. From de89d8051d1fa6122f927bb5ab27644e9b070958 Mon Sep 17 00:00:00 2001 From: "J. Patrick Fulton" Date: Thu, 24 Aug 2023 12:50:33 -0500 Subject: [PATCH 6/6] Finish and link markdown files. --- README.md | 5 +++++ SETUP_BASIC_NETWORK.md | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b16bebd..9fd45a9 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,8 @@ ssh-keygen -t ed25519 -C "username@domain.com" ## Install a Native OpenVPN Client Install [Tunnelblick](https://tunnelblick.net/downloads.html) for macOS. + +## Next Steps + +To create a basic personal network with a Samba Server configured for +compatibility with macOS Time Machine follow this [guide](SETUP_BASIC_NETWORK.md). diff --git a/SETUP_BASIC_NETWORK.md b/SETUP_BASIC_NETWORK.md index 9d9697a..b527085 100644 --- a/SETUP_BASIC_NETWORK.md +++ b/SETUP_BASIC_NETWORK.md @@ -1,10 +1,10 @@ # Setup a Basic Personal Network -Follow the prerequisite steps and installations from the main repository +Follow the prerequisite steps and installation instructions from the main repository [README](./README.md). -From the root of this repository navigate to the control scripts folder with -the command: +From the root of this repository navigate to the control scripts folder in +a terminal with the command: ```bash cd scripts