Linux [ServerSupport]

Configuringring SAMBA Server - Linux

Packages Required

  1. Samba Server Package
    1. samba-3.0.28-0.el5.8
    2. system-config-samba-1.2.39-1.el5
    3. samba-client-3.0.28-0.el5.8
    4. samba-common-3.0.28-0.el5.8
  2. Check Samba service is running..
    $ sudo /sbin/service smb status
    smbd (pid 29505 29500 5002 4222) is running...
    nmbd (pid 29503) is running..
  3. Configuring file is smb.conf, and its location is "/etc/samba/smb.conf"

Lines to be edited / added to smb.conf file

#======================= Global Settings =====================================
# ----------------------- Network Related Options -------------------------
edit line 74 → workgroup = SAMBAWORLD
edit line 75 → server string = Samba SAMBA-BLR Server Version %v
# --------------------------- Logging Options -----------------------------
# logs split per machine
edit line 90 → log file = /system/var/log/samba/%m.log
# max 50KB per log file, then rotate
edit line 94 → max log size = 50
# ----------------------- Standalone Server Options ------------------------
edit line 105 ↠ security = user
; passdb backend = tdbsam
#----------------------------- Name Resolution -------------------------------
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups.
line 213 → dns proxy = no
# --------------------------- Printing Options -----------------------------
# Load Printers let you load automatically the list of printers rather
# than setting them up individually
edit line 227 → load printers = yes
edit line 228 → cups options = raw
#============================ Share Definitions ==============================
edit line 254 → [homes]
edit line 256 → comment = Home Directories
browseable = yes
writable = yes
; valid users = %S
; valid users = MYDOMAIN%S

comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.

Add from Line 352 →
comment = Project Data
path = /projdata/Data/
valid users = user1, user2, user3, user4
public = no
writable = yes
; printable = no
create mask = 0775
browseable = yes

comment = Disk2 Partition Shared
path = /Disk2/
valid users = User1
public = no
writable = yes
; printable = no
create mask = 0775
browseable = yes

Now save the file and close.

Steps after editing smb.conf

  1. Restart Samba Service.
    ~]$ smbclient -L (enter ↲)
    Note: Here will be your host ip address.
  2. smbclient -L (enter ↲) (enter ↲) : This command displays the shared folder for windows.
    The below command to verify the samba service.
    ~]$ smbclient -L
    Anonymous login successful
    Domain=[SAMBAWORLD] OS=[Unix] Server=[Samba 3.0.28-0.el5.8]

    Share Name Type Comment
    IPC$ IPC IPC Service (Samba SAMBA-BLR Server Version 3.0.28-0.el5.8)
    homes Disk Home Directoreis
    Disk2 Disk Disk2 Partition Shared
    Proj_Data Disk Project Data Shared

    vasu-printer Printer lq3055
    Anonymous login successful
    Domain=[SAMBAWORLD] OS=[Unix] Server=[Samba 3.0.28-0.el5.8]

    Server    Comment
    ---------    -------
    GANGA    Samba SAMBA-BLR Server Version 3.0.28-0.el5

  3. command to add users to samba server
    $ smbpasswd -a user1 [ This command add user to samba server asking to enter the password]
    once the user is added the password information is stored in /etc/samba/smbpasswd file.
    Note: once the user is added to samba server need to restart the samba service.
    we can also use the command $pdbedit -a

Usage of different Samba Commands

  1. pdbedit
    • pdbedit -L --> List the samba users
    • pdbedit -L -v --> List the samba users with verbose listing format, giving other details that is shared folders to users

Click here, to access the man page for pdbedit.


Accessing SAMBA Server from Windows

  1. Click on Start Button → Run
  2. in Run window type and click on Ok.
  3. Now you will be asked to enter Username & Password. Once you enter the details Shared folders window will be opened


Windows [Client Support]

Accessing SAMBA Server.

Accessing of SAMBA Server from Windows PC.

See how to setup OpenVpn Client in Windows  /  Linux

Steps to Access Samba Server.

In Windows user RUN window (click on Start Button --> RUN) OR use windows flag button + R to open RUN window

Now type samba server IP address in RUN window. You can get the IP from your IT Person.

Now you will be asked to enter user name and password.

Type Username & Password and select on OK button.

Now a you can see window opened with shared folders.
Note: You can acess only your home folder and the folders allowed to you.

Ex: One Shared Folder Opened.

Mapping selected shared folder to drive. Right click on folder and click on Map network drive

Assigining Drive letter on shared folder Map network drive

After clicking on Finish, new explorer will be opened with given drive name. Mapping network drive