In the getting started section of this Ubuntu new user guide – I showed how you can view Windows and Mac drives using the winmac_fstab script to set them up to automatically mount when you login. But that’s for drives on your local PC in Ubuntu Linux 5.10. If you have Windows computers on your home or office small network, you would probably like to share files with them, and you can – using SAMBA!
Samba is a Windows compatible file and printer sharing service that you can install and run. I believe by default in Ubuntu it’s already running. Follow the official Samba How To and Reference Guide for install, configuration, and testing instructions.
You will find all this information in the Official How To Guide, but basically once Samba is installed (using Synaptic Package Manager if you don’t already have it), you are going to edit a text file for cofiguration called “smb.conf”. You’ll find this fill in Ubuntu 5.10 in /etc/samba/smb.conf. You will add (or remove) the options from that configuration file that you need to customize it to your liking. You will choose to set it up for access by user accounts, and last you will add a default account (or accounts) under System -> Administration -> Users and Groups to access your system from Windows machines.
All the correct information is in the How To Reference Guide above, but here are some pointers from someone who just set Samba up for windows file and print sharing:
make sure your username map line is right, like this:
username map = /etc/samba/smbusers
In the guide you will follow instructions to create a samba userfile, and your smb.conf file will point to this like the line above. If your username file isn’t mapped properly, you will never be able to connect from a windows computer on your network.
On your Linux computer, make sure that under System -> Administration -> general (tab) that the “Host” is the name of your computer (as it will be shared on the network). Also, make sure that the line:
workgroup = MSHOME
is the name of the actualy workgroup your home or small office lan is called.
If your Windows PC’s are Windows XP, just use the file and print sharing wizard, answer the questions, and make sure to set your workgroup correctly. Be sure the workgroup is the same as what you entered on the Linux PC during setup.
Last – make sure that you setup share(s) on your Linux box by going to “System -> Administration -> Shared Folders”. You can share mounted drives as well (I do), by using the “/media/hda1” path in your smb.conf file as well.
That’s pretty much it….once you setup the Linux PC run the “testparm” command from the terminal to make sure you edited your config file properly. Then, on the Windows PC, add a new network place by browsing your enter network to find your linux PC, and then enter the account and password you setup for sharing on the Linux PC. If it connects you are good to do, if not read the troubleshooting section of the Samba Reference and How To Guide.
originally posted: 2006-01-24 00:32:07 -0400