Posts Tagged ‘Ubuntu’

Samba on Ubuntu


If you wish your computer to act as a Samba server (act as a file or printer server) then install, SAMBA by any method.

$ apt-get install samba



Client variables


Client’s architecture (see Table 6-1)


Client’s IP address (e.g.,


Client’s NetBIOS name


Client’s DNS name

User variables


Current Unix username


Requested client username (not always used by Samba)


Home directory of %u


Primary group of %u


Primary group of %U

Share variables


Current share’s name


Current share’s root directory


Automounter’s path to the share’s root directory, if different from %P

Server variables


Current server process ID


Samba server’s DNS hostname


Samba server’s NetBIOS name


Home directory server, from the automount map


Samba version

Miscellaneous variables


The SMB protocol level that was negotiated


The current date and time


The value of environment variable var

Samba Server Manual Configuration : editing /etc/samba/smb.conf

The file *smb.conf* is divided in several sections:

* Global Settings
* Debugging/Accounting
* Authentication
* Printing
* File sharing
* Misc
* Share Definitions

First we will introduce three basic configuration options that can appear in
the [global] section of the smb.conf file:

1) Global Settings


=> # "Server configuration parameters"
netbios name = (Computer NAME)
server string = (Short Details of PC)Samba %v on %L
workgroup = (WORKGROUP)
encrypt passwords = yes
=> # "Networking configuration options"
hosts allow = 192.168.220. 134.213.233.
hosts deny =
interfaces = \
bind interfaces only = yes
(bind above mentioned interface only)

# "Virtual Server Configuration Options
netbios aliases = sales accounting admin ( used to give the Samba server
more than one NetBIOS name
include = /usr/local/samba/lib/smb.conf.%L

# "Logging Configuration Options
log level = 2 (log levet 1 - 10 {As u select higher level u will get
more information.})

log file = /var/log/samba.log.%m
max log size = 50 (in KB)
debug timestamp = yes/no

debug timestamp
= 2 ( numeric (0-10) )
syslog only = yes/no (uses syslog entirely if yes )

# "Authentication of Clients
security = (share/user/server/domain)

2) Share Definitions

path = /export/samba/data (Path to Share Folder)
comment = Data Drive (Share Name)
volume = Sample-Data-Drive (Any Name)
read only = yes/no
writable = yes /no


If you want to connect to a samba server (Windows server or an Ubuntu server running samba) you have two options, you can use the smbclient command or you can directly mount the samba file system via “smbfs”.

(A) smbfs

This package allows clients to mount samba file shares allowing them to act as local disks and thus Most people will prefer this method. Install, by any method, “smbfs”

$ apt-get install smbfs