You are here
Home > Redhat > Explain Samba

Explain Samba




Package name : samba

Service name : smb

port : 139, 445

configuration file : /etc/samba/smb.conf


Samba takes its name from the letters SMB, which stand for Server Message Block. SMB is a protocol for sharing files, printers, and other resources across a network. The SMB protocol dates back to an IBM document from 1985. SMB working together with Network Basic Input/Output System (NetBIOS) and NetBIOS Extended User Interface (NetBEUI) was adopted by Microsoft as its method of providing shared resources over the network, and became the standard for Microsoft Windows. SMB was renamed Common Internet File System (CIFS) by Microsoft in 1996 and, at the same time, Microsoft issued a draft RFC describing the protocol. However, the draft RFC never became an official standard.

To create samba user use the following command:

smbpasswd -a username

To delete samba user use the following command:

smbpasswd -x username


This example used the Windows notation of SERVERshare, but with the difference that backslashes are replaced by forward slashes. The share is mounted locally on /mnt. This assumes that a user called administrator exists on the Windows machine and has the right to view this share.

The command smbclient allows us to see the shares that are being made available by a particular host, as shown here:

# smbclient -L hostname(or) ipaddress of windows -U username


#smbclient //ipaddress (windows system)/share folder -U username

To mount windows file:

#smbmount //ipaddress/share folder -o username=administrator, password=windows password

Windows machine on the network is called smart and is offering a share called photos, you can mount the share with the following command:

# mount -t cifs //smart (or) ipaddress/photos /mnt -o username=administrator


Older versions provide an smbmount command, which is normally accessed as mount -t smbfs. The equivalent command to the previous example is:

# mount -t smbfs //smart (or) ipaddress/photos /mnt -o username=administrator


Leave a Reply

twenty + 15 =