Friday, February 25, 2011

Enable File Sharing In Ubuntu Using Samba

We all know that there is so many difficulties in sharing files when we use Ubuntu or any Linux system. Especially when we want to connect a Linux machine to a windows machine. But I found an easy way to connect and share files from a Linux machine to a windows network. it works as same as in windows. First requirement to do that  is a package called Samba
Normally now a days the samba packages are available in the ubuntu 10.10 or higher. Try this check to know if you have Samba installed.
Open Terminal and type this command
apt-cache search samba 
If Samba is installed the Output will be like this
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)

Dont worry if you are not having the package. just browse to the folder you want to share. then right click->click the option called Sharing Option . Then you will be seeing a warning that Package not installed, Will be a Button telling install the package. click it . and then it prompt for the Password. Type the password correctly , the Package download will start and install the package automatically. 
Well that is it... Samba is installed . Or If you are fond of in doing in Terminal. here is the conmmand for you.
sudo apt-get install samba smbfs
Any Way if completed installation in any of these methods. the time is now to Check the Configurations correct   
vi /etc/hostname c(To change The Host Name Of the computer)
Press Alt+f2 and type
gksu gedit /etc/samba/smb.conf
then edit the Workgroup= ur workgroup
then 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
Then go to the "Share options" when right click to the folder which you want to share. 
Tick "Share this folder" option.
Congrats....!!!  Your folder has been Shared.
Go to the Windows machine type the ip addressin of your Linux machine [For that $ ifconfig in the terminal in Linux] in the Run. your Shared files are visible there... 

Share This!

No comments:

Powered By Blogger · Designed By Seo Blogger Templates