Thursday 18 April 2013

Samba Configuration in Ubuntu and Linux

 Samba Configuration

                                           
One of the most common uses of a Ubuntu 12.04 Precise Pangolin machine – whether a server or a desktop – is to share files across the network. If you’re not familiar with the term, “file sharing” means to make a folder on your system available to clients on the network. Most Ubuntu 12.04 Precise Pangolin systems use the “Samba” software, since it is can easily share files with Windows-based computers.
In this post we’ll show you how to set up a basic Samba server, and how to access those shares from client computers, on a Ubuntu 12.04 Precise Pangolin machine.

Samba has a vast array of options and configuration settings, but here we’ll show you how to set up and configure a basic Samba server with one user.
First, you’ll need to install Samba. Make your way to a command prompt and type this command:
For Ubuntu
rahul@rahul-desktop:~$ sudo apt-get install samba

For Linux
rahul@rahul-desktop:~$ yum install samba

It’s important to realize about Samba is that it stores its own set of user accounts, separate from the main accounts, in the /etc/samba/smbpasswd file. That means you’ll need to create a separate Samba password for every user you want to access your file shares.
You create this password using the smbpasswd command. For example, to create a command for a user named camalas, here’s how the command should look:

rahul@rahul-desktop:~$ sudo useradd rahul
rahul@rahul-desktop:~$ sudo smbpasswd -a rahul

 Once rahul’s password is created, the next step is to configure the file

rahul@rahul-desktop:~$sudo vim /etc/samba/smb.conf

The smb.conf file is long and rather complex, but for the purposes of this demonstration, you can ignore most of it. Key down to the very end of the file and insert this text:
[samba-share]
   comment = For me only
   browseable = yes
   writable = yes
   path = /home/rahul
   printable = no
   guest ok = no
   valid users = rahul
                           

The settings specified above will share the samba-share folder we created earlier, and give your username and your username alone permission to read and write to the folder. Once you have input the changes, save smb.conf, exit vi, and restart Samba with this command:

rahul@rahul-desktop:~$sudo /etc/init.d/smb start

Once Samba has started, use this command to check your smb.conf for any syntax errors:

rahul@rahul-desktop:~sudo testparm
If you pass the testparm command, Samba should be working. Try accessing the share from another client on your LAN.

Now Access in Windows
go to run and type //IPof samba server
like //10.10.10.142
                                      


Watch My youtube Video for your reference .................................................


No comments:

Post a Comment