Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

SAMBA is a Windows AD and SMB/CIFS fileserver for UNIX. To use this service you need to edit its configuration file /etc/samba/smb.conf. Structure of this file is similar to windows ini-files:

ini file
[section]
name = value

So, let's edit our configuration file, open it in your favorite text editor and let's go.

Write here your workgroup, this group will be visible to your windows clients:

global section
[global]
# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

Don't forget to specify networks that can use the server:

restricted access
[global]
    hosts allow = 192.168.0.128/28 192.168.1.0/24

Now let's specify some share for our windows friends:

share definition
[tmp]
   comment = Temporary data
   path = /var/tmp
   browseable = yes
   writable = yes
   public = yes

Here section name is the name of shared resource (what clients see); comment is a description of the share; path is the full path to the shared directory on your samba server. All other options (and more) are described in the samba documentation.

It's time to start the service.

starting the service
root@dilos:~# svcs smbd
STATE          STIME    FMRI
disabled       14:54:55 svc:/smbd:default
root@dilos:~# svcadm enable smbd
root@dilos:~# svcs smbd
STATE          STIME    FMRI
online         17:15:15 svc:/smbd:default

Let's check the server is working now:

checking the server
debian# smbclient -L 192.168.13.3
Enter root's password: 
Domain=[DILOS] OS=[Windows 6.1] Server=[Samba 4.5.6-Debian]

    Sharename       Type      Comment
    ---------       ----      -------
    print$          Disk      Printer Drivers
    tmp             Disk      Temporary data
    IPC$            IPC       IPC Service (Samba 4.5.6-Debian)

That's all. You can see in this output name of the shared resource (tmp) and its description (Temporary data).

Sometimes you may want to run windows name service, just start nmbd service like we did it with smbd:

starting nmbd
root@dilos:~# svcs nmbd
STATE          STIME    FMRI
disabled       14:50:58 svc:/nmbd:default
root@dilos:~# svcadm enable nmbd
root@dilos:~# svcs nmbd
STATE          STIME    FMRI
online         17:27:10 svc:/nmbd:default





  • No labels