Thursday, March 26, 2009

Sharing folder with Windows on Ubuntu using Samba

Tech Blog - Recently I was asked by one of my friends that is trying to use Ubuntu Linux on how to share his files on the Ubuntu Desktop to the rest of the computers on his network which are mostly running Windows, so I told him to install and setup Samba on his Ubuntu desktop once installed and configure he would be able to share files and folder through the network with any Windows computer, this is a basic howto on setting up Samba on an Ubuntu desktop.

Steps to setting up Samba

Step 1 - Go to your terminal and check if Samba is installed using the following command, or you can also check it using the GUI Synaptic Package Manager

$ dpkg -l | grep samba

Step 2 - if Samba is not installed use the following command to get it, or you can install it through the Synaptic Package Manager

$ apt-get install smbfs samba

Step 3 - Configuring Samba

Goto > System > Administration > Networking, and goto General tab enter your hostname
Goto > System > Administration > Shared Folders > click General Properties then enter a name for Workgroup.
Goto > Applications > Accessories > Terminal once you see a prompt type

$ vi /etc/samba/smb.conf

Here you have the option to further cuztomize the configuration of your Samba install such as

Making the shared folder writable by editing the line and changing "no" to "yes"
writable = no

To make the folder browseable over the network
browseable = yes

Vi Note: you can find the line on vi by doing a search on the term type /searchpatternhere
Vi Note: You need to press "i" to enter edit mode on Vi
Vi Note: You need to press "ESC" to enter view/command mode on Vi Vi Note: To exit vi press "ESC" key then hold shift and press zz to save and exit.

After doing changes you can save and exit

Now you will need to create a userrname/password to protect your share folder
$ smbpasswd -a username

Restart Samba so that Samba daemon will reread the newly edited configuration file.
$ /etc/init.d/samba stop
$ /etc/init.d/samba start

Now you should be able to share any folder by clicking on it and selecting share through smb, and your Windows should be able to see it.


Another way of sharing files on Ubuntu is by allowing Windows user to connect to your desktop using scp client such as winscp.


Tech Blog Quick List of howto's:

No comments:

For suggestion and concerns E-mail