|
Networking with Ubuntu 8.04 and Windows Part 1
Installing the Samba Package for UbuntuCan't seem to find the shares of Ubuntu machines from My Network Places or Network in Windows? You'll soon find out it's not a hide-and-seek game you'll win unless you start playing with features that exist on the computer, rather than chasing those you imagine are installed and setup. Though Ubuntu can see the shared files and printers of Windows machines out-of-the-box, Windows can't see Ubuntu shares by default. However, don't give up yet and purchase another XP or Vista license; you can have Ubuntu 8.04 and Windows talking in no time. Computers must have compatible resource sharing protocols installed in order to communicate with each other. Think of two people trying to talk to each other in different languages; nothing will be communicated until they speak a language they both understand. The same principal applies with the communication on a computer network. By default, Ubuntu doesn't come with a protocol installed that gives it resource sharing capability. Therefore the first step is to install a protocol that will enable you to share files and printers. You have two main protocols you could use with Ubuntu: NFS (Network File System) developed by Sun Microsystems for Linux/Unix, and SMB (Server Message Block) primary used in Windows. Windows uses SMB by default, thus installing the SMB protocol on your Ubuntu machine will get the conversation started by opening up two-way communication between the Microsoft operating system and Linux distribution. In the open-source World, the Samba package can give your Linux computer the SMB capability. The following steps show you exactly how to install the Samba package in Ubuntu:
If you can't find samba, refer to the next set of steps and then come back here.
If you don't see the samba package you may have disabled Ubuntu from searching the Main repository, or archive, of Ubuntu's officially supported software. If this is the case, you can follow these steps to enable the Main repository so you'll have access to the samba package:
Creating a SMB Password in UbuntuBy default, Samba requires you to configure a password for use when accessing the shares from other computers. (In a later part of this series we'll discuss advanced sharing configuration, like guest shares) This will be, for example, the password you'll use in conjunction with your Ubuntu username when prompted to enter logon credentials after double-clicking a computer icon in the My Network Places or Network window in Windows. Creating a username for Samba only takes one line of code in Terminal:
Replace the word username above with the login or user name of your Ubuntu account, as you can see in the example shown in Figure 2. If Terminal comes back and says
If you received the
The text editor should pop-up with the hosts file opened.
Allowing Ubuntu Desktop Users to ShareSince sharing folders on a network makes your files more vulnerable to access by unauthorized people, letting everyone have the right to share shouldn't be in your computing bill of rights. The Ubuntu developers recognized this thought and made it so only Administrator accounts can, by default, share folders and files among the network, leaving users classified as a Desktop User or Unprivileged out of the loop. However, if you have non-Administrator accounts that you want to be able to share, giving these accounts sharing privileges only takes a simple change in the Users and Groups window:
Changing the Workgroup for Ubuntu When browsing through the computers on your network, such as from My Network Places in Windows XP or the Network window of Vista or Ubuntu, you'll see that computers are divided into groups. These groups are either a Workgroup (used on small networks) or Domain (used in larger more complex networks) and exist to help control what users have access to on the network. Since you're probably working with a small network, you are likely using a Workgroup (rather than a Domain) and each computer on the network should be set to the same Workgroup. The default Workgroup value after installing the Samba software on Ubuntu is WORKGROUP. This may be the same value of your Windows PCs; however you should double-check and follow these steps if a change is necessary on your Ubuntu computer:
If you don't see the Shared Folders shortcut, click Applications | Accessories | Terminal, type shares-admin and hit enter.
You can alternatively change the Domain/Workgroup value by editing the smb.conf file; here's precisely how to:
The text editor should pop-up with the smb file opened.
Changing the Computer Name in UbuntuAfter browsing to and selecting a Workgroup from the network browser of your computer, you'll see icons for each computer on the network and in the Workgroup, that's properly configured for sharing. These icons are labeled by what is called the Computer Name of each particular computer. You might also use the Computer Name when manually accessing computers with the UNC path; for example by typing The value of your Computer Name for your Ubuntu computer is probably your account username and the word desktop. However you may want something more descriptive, or that fits into any naming convention you already use, so you or others can better distinguish between computers on the network. If so, you can follow these steps to change the Computer Name in Ubuntu:
What's NextNow that you've set up Ubuntu to share with Windows, in the next parts of this series we'll discuss exactly how to share folders and printers in Ubuntu and use remote desktop connections between the two platforms. 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. Eric Geier is an author of many wireless networking and computing books, including Home Networking All-in-One Desk Reference For Dummies (Wiley 2008) and Wi-Fi Hotspots: Setting up Public Wireless Internet Access (Cisco Press 2006).
|