Friday, June 17, 2011

Using SAMBA Sharing the Directory in a LAN (BOSS 4.0 GNU/Linux )

Global Parameters

[global] Anything in here applies to Samba as a global setting. There is some configuration info here that is important so that Samba and your Windows pc's will function properly. However some global settings can be overridden by share settings (more on this later). I will now go through each line and give a brief description of what role it plays in Samba.
workgroup = home: this is the name of your network group. It is important that both Samba and Windows are in the same workgroup. Please read your Windows documentation on how to change your Windows pc's workgroup name.
netbios name = Samba: netbios name is what you will see in your Windows pc "Network Neighborhood" for your Samba server.You can name this anything you wish. If you leave it blank, it will default to your host name.
encrypt passwords = yes: Samba can work with encrypted or unecrypted passwords. However, Windows 98, Windows NT, and Windows 2000 utilize encrypted passwords. The only time that this should be set to no is when you have any older Windows systems running on your network ie: Windows 95, Windows 3.x. If this is the case you will have to do some registery modifications to your Windows 98, NT, 2000 to allow them to send unencrypted passwords accross the network. Not the most secure situation though.


#global parameters
workgroup=home
netbios name=samba
encrypt passwords=yes

Share Parameters

[homes] When you create a user on your Linux pc (more on this later) it will automatically create a home folder for you in /home/yourusername. Think of this as your "My Documents" for Linux.
read only = no: By default Samba will always make any directory read only for security reasons, so we need to let Samba know that we want to be able to write to this directory.
browseable = no: defines when you map a network drive to Samba, it will map directly to your user directory ie: \\home\mw (this is my username on Linux and Samba) This share /homes/mw is browseable only by you. Remember this is much the same as the "My Documents" folder in Wndows
 
[share] This will create a share that is viewable, and writeable by anyone. This is not at all a secure share. Anyone can do whatever they wish, including deleting files that are not their own. I strongly do not recommend this type of sharing. I have given this example for illustrative reasons only.
path = /srv/samba/share: This tells us the directory is found on the Samba server as/srv/samba/share, and that when we will map the network drive it will be seen as "share" in Network Neighborhood
***To make this directory open a terminal window and type in md /srv/samba/share. Or this can be done from a file manager

read only = no: By default Samba will always make any directory read only for security reasons, so we need to let Samba know that we want to be able to write to this directory.
browesable = yes: This share will show in in Network Neighborhood as "share"

[rajendran]

same as share configuration

# Shared Parameters
[homes]
read only=no
browseable=yes

[share]
path=/srv/samba/share
browseable=yes
public=yes

[rajendran]
path=/srv/samba/rajendran
browseable=yes
public=yes

Adding Users and Restarting Samba

root@boss[~]#smbpasswd -a chamy
New SMB password:
Retype new SMB password:

restart the samba service

root@boss[~]#/etc/init.d/samba restart
Stopping Samba daemons: nmbd smbd.
Starting Samba daemons: nmbd smbd.


check whether samba is active or not

root@boss[~]#smbclient -L //samba -U chamy%chamy
Domain=[HOME] OS=[Unix] Server=[Samba 3.5.6]

    Sharename       Type      Comment
    ---------       ----      -------
    homes           Disk    
    share           Disk    
    IPC$            IPC       IPC Service (Samba 3.5.6)
    chamy           Disk      Home directory of chamy
Domain=[HOME] OS=[Unix] Server=[Samba 3.5.6]

    Server               Comment
    ---------            -------
    SAMBA                Samba 3.5.6

    Workgroup            Master
    ---------            -------
    HOME                 SAMBA

Now the directory specified on the smb.conf are shares across the network

This is worked for me.

No comments:

Post a Comment

JMeter JSON Extractor

      json response {"Key1":"Value1","Key2":"Value2","Key2":"Value2"}  Name of t...