Sharing System Resources
We discuss networking in Chapter 7, "Master Vista Networking," and NTFS permissions in Chapter 5, "Disk Configuration and Volume Tricks," but here we want to talk about the simple concept of sharing. You have files, other networked users want access to those files, and sharing is the key. How is it done, how can you monitor what is being shared, and who is accessing it on your system?
Sharing Files Through the Public Folder
The Public Folder (in XP called the Shared Documents folders) is the convenient and easy way to share files. Putting things in the public folder allows anyone who can access your computer to see and use the files as well as anyone who has been granted access to the files remotely via the network. There is only one set of public folders per computer, so all users on the computer add things to the same location.
To see the public folder, select the Start orb and then click Documents. You'll see a folder called Public in the Favorite Links pane. When you open it, you can see that other folders have already been created to make this easier: Public Documents, Public Music, Public Pictures, and so forth. All you have to do is copy or move the files over that you want to share to these locations.
Anyone with a username and password on your computer can sit down and access these folders, but you can determine how people across a network connection can (or cannot) access them.
If you want to make sure a person has a username and password on your system to access those folders, open the Network and Sharing Center (click Start, Network and click the Network and Sharing Center button on the Command bar). Look for the arrow next to Password-protected Sharing and then turn it on or off. Make sure, too, that the Public folder sharing is on. You can alter the permissions people have in accessing the Public folder by selecting the Public Folder Sharing option and then selecting one of the following options:
- Turn On Sharing so Anyone with Network Access Can Open Files
- Turn On Sharing so Anyone with Network Access Can Open, Change, and Create Files
- Turn Off Sharing (people logged on to this computer can still access this folder)
One thing to take note of is that this method of sharing doesn't allow you to structure permissions on a per-user basis. If individuals can access the Public folder, then they all have the same set of permissions that you apply. If you want to give different users different permissions, or if you don't want two copies of files on your system one in your real folder and one in the Public folder), you might want to share out a different folder altogether on your system.
Sharing Any Folder
You can right-click a folder and select Share. By default, this turns off the File Sharing Wizard. You can choose to share with users who are configured on the system with user accounts, or you can just allow everyone to access the folder through the share. This means users on other systems will be able to access the share even if they don't have an account on your machine.
If you don't like the wizard and prefer to share folders manually, you can turn off the wizard. Open the Control Panel and select Folder Options. Select the View tab and scroll down to the Use Sharing Wizard (Recommended) checkbox and deselect the box. Now, when you right-click a folder and select Share, you will be taken to the Sharing tab under the folder's properties. You will also see that the Share option is grayed out for the basic sharing. Instead you have to use the Advanced Sharing options (see Figure 3.8).
Figure 3.8 Configuring the Advanced Share Permission settings.
You might notice that you can also determine the number of users who can access the shared folder at any given time. The default setting is 10. You can control this further. If you know for a certainty that you only have 1 other person, for example, that will access the share, you can lower this to 1, and this will prevent others from accessing (or trying to access the share).
The permissions you see aren't all that complicated to understand. You have Full Control (Allow or Deny), Change (Allow or Deny), and Read (Allow or Deny).
If we broke these down into smaller explanations, you would have the following:
- Read—Allows you to read a file (meaning read, listen to, view, watch, and so on with that file) and execute the file (if it is a program)
- Change—Allows you to read and execute the file, but it also allows you to write to the file (that is, open a Word document and make changes) or delete the file
- Full Control—Allows you to read, write, execute, and delete the file; plus you can take ownership of the file if you want and change the permissions of the file
Allow/Deny is an interesting dilemma. If you, as a user or a group you belong in, is assigned Deny in any way, shape, or form, on the object (printer, folder, drive share, and so forth), the Deny permissions are stronger than any of your Allow permissions.
To illustrate, let's look at an example of a shared folder. By default, everyone (which includes you) is given Full Control to access that folder through the share. However, you are part of a specific group that has been denied the ability to Read the folder. So this means that through the share, you won't even be able to open the folder to look inside. However, you could change these permissions for the group you're in because you have that ability through the Full Control set of permissions. After changing the permissions, you could then enter the folder.
If you think this is complicated, wait until we throw NTFS permissions into the mix.
Other ways you can share a folder are covered in the following sections.
Shared Folders in Computer Management
From within Computer Management, you have the Shared Folders options. You can right-click the Shares folder and select New Share. Regardless of your folder options, this turns off the Create a Shared Folder Wizard.
From within Computer Management, you can do a couple of great things with Sharing. If you select the Shares folder, you can see all the folders and drive letters (even hidden ones) that are shared out on the system (see Figure 3.9). From here, you can right-click any share and choose not to continue sharing that folder. You can also go into the Properties of the share and alter the configuration, including the Share and NTFS permission settings.
Figure 3.9 We are back in Computer Management, this time looking at the Shared Folders options.
If you select Sessions, you can see the users connected to your shares, which computers they are on, how long they have been connected, and so on. From here, you can right-click any user connected in a session and close the session.
You can also select the Open Files folder to see which files are being viewed, and you can right-click any file and close it. You should notify a user before you do this because otherwise the work they are performing on the file might be lost.
Creating a Hidden Folder Share Is $
Why would you want to hide a share? Dorin Dehelean explains the reason to http://www.windowsitpro.com by saying:
For someone to connect to those hidden shares, he must know they exist and then type in the share name correctly when he maps to that share.
Connecting to Shares
You can view shares over the network by opening the Network window and viewing which systems exist that have shared folders to which you can connect. This is certainly the easiest way. Or, you can connect to a system using a mapped network drive.
A mapped network drive is basically a configuration in which you select a drive letter and type in a universal naming convention (UNC) path to the resource with which you are looking to connect. It sounds complicated—and it can be.
Right-click Computer or Network and select Map Network Drive to see the options. Or, from within Computer, you can select the option to Map Network Drive. When you select the option, you see the dialog box in Figure 3.10.
Figure 3.10 Mapping a network drive.
To map the drive, you select an available drive letter and then select the path. The path is \\servername\sharename\<path>. So, if you wanted to connect to a computer named Solitude to a share named Sharing, you would type \\solitude\sharing. You could also click the Browse button to see which shares are available, but you won't see hidden shares. To connect to those, you have to enter the share name with a $ at the end.
You can also choose to reconnect at logon so that you will reconnect each time to that share and will not have map the drive each time.
Keep in mind that you can also connect to the server by using an IP address. So, you can also type \\serveripaddress\sharename.
To map a drive from a command prompt, you use the NET USE command by typing the following:
NET USE <drive>: \\<server>\<share>\<path>