If you opt to share folders across a network under Ubuntu you'll find they're protected with your username and password, which you might not want to share with others. The Shared Folders dialog box allows you to setup guest access but, at the time of writing, this had a serious bug that rendered it unusable.5
Below is described a method of securely, painlessly and easily sharing files with colleagues or other computers in your house across the network, regardless of whether they run Ubuntu, Windows or Mac OS X. It involves creating a dummy guest account solely for the purpose of hosting the shared files and folders. Note that these instructions were written using Ubuntu 8.04.1 Hardy Heron:
1. Use Synaptic to install the samba and libpam-smbpass packages. These are the background programs that are needed for filesharing and user authentication.
5. The bug with guest access on shared folders (on an Ubuntu 8.04.1 installation) is that files added to the folder by other users are owned by user "nobody", and the Ubuntu user whose shared folder it is only has read access. To change the ownership and permissions you will need to use admin powers at the command-prompt each time a file is placed there.
Share files across the network (without tearing your hair out) M 85
Figure 3.6: The sharing dialog box might report an error but this is a bug (see Tip 28, on the previous page)
2. Create a guest account. You'll use this for hosting the shared folder(s), and the other computers will use its login details to access the shared folder. To create the account, click System ^ Administration ^ Users and Groups. Click Unlock and then the Add User button. Give the new user the username guest and give it a simple password in the User Password field that you'll be able to share with others. Leave the other text fields as they are. Click the User Privileges tab and check Share Files with the Local Network.
3. Log out of your account and into your new guest account. Create the folder(s) you want to be used for sharing (it doesn't matter where—you might as well create it on the desktop; nor does it matter what name you give it). Then right-click it and select Sharing Options. Click Share This Folder and type a share name in the relevant text box (you might see error messages while doing this but don't worry, as seen in Figure 3.6; it appears the dialog box is a little buggy). Check Allow Other People to Write in This Folder but don't check Guest access! Then click Create Share. You'll be prompted to add permissions automatically, so click to do so. Right-click any other folders you wish to share and repeat this step, and then log out and log back into your main user account. Note that there is no need to leave the account logged in—its shared folders are available to everybody even if the account is logged out.
4. Now you must create a permanent launcher in your regular account for the new shared folder so you can access it in future. Right-click the desktop and select Create Launcher. In the Name field of the dialog that appears, enter some memorable label, like Shared Folder. In the command field, type nautilus smb://localhost. Leave the Comment field empty, and then click OK. Double-click the new launcher and you should see the shared folder(s). Double-click the shared folder and, in the dialog that appears, enter guest in the Username field, and the password you created in the relevant text field. Then check Remember Forever. You should now have access to your shared folder. A useful tip is to hit (Ctrl ]+[d to create a Nautilus bookmark. in future you can simply select this bookmark, on the Bookmarks menu, to access the shared folder.
5. Other computers should now see your shared folder appear in My Network Places, just like any other Windows computer with shared files. They should use the username guest and the password you created earlier. Don't click the "guest access" option—specify guest as the username.
There should never be any need to directly login to the dummy guest account in future, unless you specifically want to create new shared folders.
For another method of painlessly sharing files with others, see Tip 226, on page 265.
Was this article helpful?