In the final installment of our tutorial series, we'll figure out exactly how to share the files on your Ubuntu machine, both quick and easy, and with access controls.
In the first installment of this tutorial series we configured Ubuntu to share with Windows and set your Computer Name and Workgroup values. In Part II, we discovered the nitty gritty of the network connection details in Ubuntu. Finally, we'll figure out exactly how to share the files on your Ubuntu machine. We'll cover basic sharing if you want to quickly get your files on the network and advanced sharing if you prefer to customize the sharing permissions or privileges.
Once you've set up Windows sharing in Ubuntu, you can start sharing folders. The process is quite similar to what you may have experienced in Windows XP. To share files you actually share a folder. All the files and any sub-folders within the shared folder are available to others on the network. Exactly what you or others on the network can do with the shared files (for example, read-only or edit) from another computer is based upon the settings you choose when you share the folder.
Once you have a folder picked out to share, follow these steps in Ubuntu 8.04:
- Right-click the folder you want to share and click Sharing Options.
You can also access sharing preferences of folders from their Properties window; right-click a folder, click Properties, and choose the Share tab.
- On the Folder Sharing dialog box that appeared, select the Share this folder checkbox.
- Type a name for the share into the Share Name field.
This can be anything you choose that will help you and others identify the folder when browsing through all the shared folders of the Ubuntu machine from the Network or My Network Places window on another PC. This share name can differ from the folders real name, which remains the same regardless of what you input here.
- If you want people to be able to edit, add, or delete files that are in the folder, select the Allow other people to write in this folder checkbox.
This still requires users to input a username and password that was created during the SMB installation.
- If you people to be able to access the folder without a SMB username and password, select the Guest access checkbox.
- Click the Modify Share button to apply the changes and close the window.
You're done; it's that simple. Now you should be able to see this folder when browsing Network or My Network Places in Windows.
Dealing with folder and sharing permissions can get down right confusing, so let's summarize the different sharing permission scenarios we've already figured out how to apply through the Folder Sharing dialog box:
- Users have read-only access, no editing: When you share a folder, as just discussed, you can leave the permission settings alone by not marking the two optional check boxes. This means everyone on the network that has a SMB password set up can access the folder, but can't make any changes. Of course, the user that shared the folder has full access.
- Users have read/write access: Marking the second check box, on the Folder Sharing dialog box, gives the users the privilege of editing the files in the folder.
- Guests receive read access: The third check box, on the Folder Sharing dialog box, lets you offer guest access (without editing rights) to users that don't have a SMB password. Marking both options gives everyone, even people with out an account, privileges to make changes to the files in the folder.
- Everyone (including guests) has read/write access: This is achieved when you mark both the second and third check boxes on the Folder Sharing dialog box. This option is not recommended for wireless networks unless you have a highly secure network, for example if you are using WPA encryption.
Setting Advanced Sharing Permissions
You can edit the advanced permissions by right-clicking the folder you shared
and selecting Properties
, and then by clicking the Permissions
tab. You'll see options similar to what's shown in Figure 2. You can configure a separate access type for the Owner, Group, and Others. Selecting None or List Only Files wouldn't give any access of the folder to the particular party, choosing Access Files gives read-only access, and Create and Delete Files would give complete access.
Fiddling around with the permission settings for the Group and Others gives you a few more useful sharing permission scenarios:
- No one has access, except for folder owner: This option is typically the best way to share folders that you don't want others messing with; only you can see and edit them. This is achieved by selecting None for the Folder Access of the Others and Group categories.
- General users have no access; accounts belonging to a certain group have read/write access: This scenario is a great way to share folders only to specific users. For example, you could create a Parents or Management group so you can share files between only you and your spouse or you and others on the management team, keeping your children or employees in the dark. Achieving this scenario consists of choosing None for the Folder Access of the Others and selecting Create and Delete Files for the Folder Access of Group. Then you would select the Group you want to apply the permission to. If you haven't set up Groups yet, you would want to reference the next sections before implementing this scenario.
- General users have read-only access; accounts belonging to a certain group have read/write access: You can implement this scenario by selecting Access Files for the Folder Access of Others and choosing Create and Delete Files for the Folder Access of Group. As with the previous option involving Groups, you first need to create and assign groups for your Ubuntu accounts using the sections that follow, and then you can select the Group you want to apply the permission to.
Creating and Assigning Groups for Your Accounts
If you want to use a sharing permission scenario involving Groups, as discussed in the last two bullets of the previous section, you must first create Groups. Then you can assign accounts to these Groups, letting you set unique sharing permissions to a select number of accounts. Creating the Groups is a simple task; just follow these steps:
- Click System | Administration | Users and Groups.
- On the User Settings window, click the Unlock button, choose an Administrator account, enter the account password, and click the Authenticate button.
- On the User Settings window, click the Manage Groups button.
- Click the Add Group button (see Figure 3), and on the New Group dialog box, enter a Group Name and select the accounts you want to be in the group, and click OK.
Now you can use Groups when setting permissions for your shared folders.
You should have your Windows and Ubuntu machines talking now, and know the ins and outs of networking with Ubuntu. Happy networking, and stay open-source!
Remember you have many resources at your disposal when you run into problems; here are a few you may find useful: Ubuntu Documentation, Ubuntu Forums, and JustLinux Forums.
About the Author
is the Founder and President of Sky-Nets, Ltd.
, a Wi-Fi Hotspot Network. He is also the author of many networking and computing books, including Home Networking All-in-One Desk Reference For Dummies
(Wiley 2008) and 100 Things You Need to Know about MicrosoftÂ® Windows Vista
This article was first published on LinuxPlanet.com.