How to Map Network Drives for a VPN

Many VPN apps allow users to map network drives so that users can connect or navigate to folders on remote machines, freeing up valuable time for more important tasks. Unfortunately, mappings can sometimes revert to the default after a system reboot. If you’re looking for a way to keep your mappings between reboots, you’ve come to the right place.

Use a Snapshot to Ensure Mappings Are Persistent

Creating a snapshot is the easiest way to map a network drive for a VPN. A snapshot is a copy of the entire drive at a specific point in time. When you create a snapshot, it will appear in your SourceTree as a local folder. You can then map this folder to a remote location so that you can access the files that reside there.

To create a snapshot, you can use the MacOS GUI or the Windows CLI (command line interface). If you’re using Windows, you can use the built-in Windows tools or third-party programs such as Microsoft’s Active Directory Administration Tool (msadc). With msadc, you can create snapshots using the following syntax:

msadc /create snapshot /name {your-snapshot-name} /path {path-to-the-folder}

Avoid The Use Of ‘\’ In The Path

Use of the \ character to escape spaces in file and path names is a common source of errors when mapping a drive for a VPN. Unless you need to use a backslash for some other purpose, it’s best to avoid using it in file and path names.

In the macOS Finder, a space character normally has to be escaped with a backslash character when entering a path name, for example:

/Users/markj/Desktop/my documents

In Windows, a space character normally has to be escaped with a backslash character when entering a path, for example:

C:\Users\markj\Desktop\my documents

Using the backslash in the path makes it much easier to type. If the backslash is not available on the keyboard, you can even use the menu options to choose the character you need.

Use An Alias When Mapping A Drive

A shortcut or alias is a short reference that you can use instead of a long path or file name. For example, if you create a shortcut on your Mac desktop called “Backup”, you can access your Mac’s ‘Backup’ folder from any workspace or device by simply entering the shortcut instead of the entire path. You can also create shortcuts for websites and apps that you frequently use.

If you frequently access the same drive at different locations, you can create shortcuts for those locations so that you don’t have to type the entire path every time. The advantage of using aliases is that they are relatively easy to remember and, therefore, less prone to be missed when entering a directory or file name. It’s also easier to add or remove shortcuts as needed.

To create an alias, you can use the MacOS GUI or the Windows CLI. In the macOS Finder, you can right-click on a file or folder and select ‘Get Info’ to display the original path (the longer path name) and any aliases associated with the item. From here, you can add or remove aliases as needed:

Get Info

In Windows, you can use the cmd (command line interface) or PowerShell to create aliases. In the PowerShell window, you can also list all the aliases for a given item by executing the following command:

Get-Alias – List All Aliases

Restrict File And Folder Access Using Permissions

You can also use permissions to control who can access a particular file or folder. Granting specific permissions to specific users or groups is the recommended way to go, as it applies the permission filters only to the files and folders that you choose. This ensures that sensitive files and folders are not accessible by others regardless of their privileges.

A few examples of permissions are:

  • Read – Allows a specific user to read the contents of a file or folder
  • Write – Allows a specific user to write to or modify a file or folder
  • Execute – Allows a specific user to execute a file or folder
  • List Folder Contents – Allows a specific user to list the contents of a folder
  • Add To Library – Allows a specific user to add a file or folder to the system’s library
  • Take Ownership – Allows a specific user to take ownership of a file or folder
  • Backup – Allows a specific user to make copies of a file or folder
  • Read And Execute – Allows a specific user to read and execute files
  • Read And List Folder Contents – Allows a specific user to read and list the contents of a folder
  • Write And Execute – Allows a specific user to write and execute files
  • Full Control – Full control, meaning that users have all permissions including the above

The best place to control permissions is in the folder’s properties dialog. In the Finder, you can right-click on a file or folder and select ‘Properties’ – from here, you can set the permissions for the item to be either public (everyone has access), private (only you have access) or restricted (only the owner has access).

Add A File Or Folder To Your Library

If you regularly access the same file or folder from different locations (say, between your workstation and a mobile device), you can add it to your library to make things easier when accessing the item again. To do this, you can use the MacOS or the Windows CLI to navigate to the desired location and add the item to your library by using the Add To Library option in the file or folder properties.

Get Info

In macOS, to add an item to your library, you can either select the item and use the spacebar to navigate to the library location or use the Go To… button in the location bar (when you’re at the desired folder or file).

You can then select the item in the library and press the Return key to rename or move it to a different location. To remove items from your library, you can either select the item and press the Delete key or navigate to the folder containing the item and delete it from there.

Use The Terminal For Command-line Operations

If you’re used to working in a command-line environment such as Linux or BSD, you can switch to using the Finder or the Windows GUI less frequently for file operations. Instead, you can use the terminal (command line interface) to perform most tasks, including creating and deleting your snapshots. You can also use the folder and file properties in the terminal to set various permissions and ownership for your files and folders. Here are some examples:

Similar Posts