Sunday, January 11, 2009

Install and Configure Samba Server for Ubuntu

Samba server is a utility for linux where in Linux filesystem folders can be exported over nfs and can be shared with the network machines. This is very helpful, when you have some of your work setup in linux and some in Windows, One of such situation is when you have to use a linux machine for your code compilation and use powerful source browsers such as source insight to develope and study/modify the code.

The Samba server setting up is an easy task, especially with the Ubuntu, things have become very easy. First install Samba server with following command.

$ sudo apt-get install samba

Once you are done with the istallation, you can export any directory to share over NFS. Assume that I have an user account with name prasad in Ubuntu machine, with my home directory at, /home/prasad. Do the following to share my home directory to me from my windows machine.

Edit the Samba configuration file (smb.conf) to add your share folder and permissions.

$ sudo vim /etc/samba/smb.conf

In vim editor, browse through this file, and find out where is the setting for home folder sharing. Enable home folder sharing, when you open the file you will understand what needs to be done, you just need to un-comment few lines. And add few lines at the end of the file to enable sharing of your home directory. These are the few lines needs to be added

path = /home/prasad
browseable = yes
valid users = prasad

Now your home directory is shared as //server-ip/prasad
You also need to create user 'prasad' for samba server access, linux user name and password does not work for this. To do that do that type these commands

$ sudo smbpasswd -a prasad

Give the password more than six char and confirm password and you are done. Restart the samba server.

$ sudo /etc/init.d/samba restart

If you find any problem feel free to ask me.

No comments:

Post a Comment