One of the best ways to share folders and files on Ubuntu is to use the free open source software, Samba.
Once installed and setup, any Windows Computer will be able to easily connect and copy files to and from your Ubuntu system just like it was another Windows Computer.
With Samba, you are not limited to just file sharing. Printer sharing can also be setup allowing Windows computer to access and print to an installed printer on your Ubuntu computer.
To get started, first check to see if Samba is installed (by default Samba usually is installed during installation).
Open a Terminal window (Applications \ Accessories \ Terminal) and at the prompt enter the following command:
apt-cache search samba
If Samba is installed, you will see an output similar to the following:
samba – a LanManager-like file and printer server for Unix
samba-common – Samba common files used by both the server and the client
samba-dbg – Samba debugging symbols
samba-doc – Samba documentation
samba-doc-pdf – Samba documentation (PDF format)
smbclient – a LanManager-like simple client for Unix
smbfs – mount and umount commands for the smbfs (for kernels >= than 2.2.x)
If Samba is not installed, just enter the following command at the prompt in a Terminal window:
sudo apt-get install samba smbfs
You can also check to see if Samba is installed using Synaptic.
Now that Samba is installed, it's time to configure and make it accessible for Windows Computers, with the step by step procedure in the following video. Don't worry if you miss something, you can check out the steps listed below after the video.
NOTE: installation of Samba in video used Ubuntu 6.10 but still applies to later versions as well.
Steps to enable and configure Samba in Ubuntu:
- Open System \ Administration \ Networking and enter password. In General tab, enter your hostname (this is your Computer name)
– Open System \ Administration \ Shared Folders then click on General Properties tab and enter a name for Domain\Workgroup.
– Open Applications \ Accessories \ Terminal and at prompt enter sudo gedit /etc/samba/smb.conf
– Uncomment the line browseable = yes (don't forget to use find and search for browseable)
– Uncomment the line writable = no and change "no" to yes
– Save the file and close
– Go back to the Terminal window and enter the following command (remember you can use any name you want): sudo smbpasswd -a username
– When prompted, enter a password and confirm it.
– Reload the Samba services using the following command: sudo /etc/init.d/samba reload
Sharing Folders (on Ubuntu)
– Open Places \ Home Folder
– Create a new folder, then right click on it and select Share Folder
– In Share Folder dialog box, set Share through: to Windows networks (SMB) and give folder a name. (if you want the share to have write access, uncheck Read only
– From your Windows Computer, see if you can connect to the folder share.
If you want to connect to shared printers from Ubuntu to Windows, check out our step by step guide on connecting to Windows shared printers from Ubuntu.
For more Ubuntu information, check out our Ubuntu tips and how-to.