Samba on Ubuntu

Server

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

Variable

Definition

Client variables

%a

Client’s architecture (see Table 6-1)

%I

Client’s IP address (e.g., 172.16.1.2)

%m

Client’s NetBIOS name

%M

Client’s DNS name

User variables

%u

Current Unix username

%U

Requested client username (not always used by Samba)

%H

Home directory of %u

%g

Primary group of %u

%G

Primary group of %U

Share variables

%S

Current share’s name

%P

Current share’s root directory

%p

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

Server variables

%d

Current server process ID

%h

Samba server’s DNS hostname

%L

Samba server’s NetBIOS name

%N

Home directory server, from the automount map

%v

Samba version

Miscellaneous variables

%R

The SMB protocol level that was negotiated

%T

The current date and time

%$var

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

[global]

=> # "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 = 192.168.220.102
interfaces = 192.168.220.100/255.255.255.0 \
134.213.233.110/255.255.255.0
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



[data]
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



Client

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: