Linux adminstartion : Samba server Configuration
Configuring the Samba Server
1)
Beginning with
version 2.0 Samba includes a utility called SWAT, the Samba Web Administration
Tool. This tool makes setting up Samba very easy.
2)
The samba
configuration file is called smb.c onf and is located in /etc/samba directory
by the installation program, a smb.conf file was created during the
installation that can be used for reference and modification.
3)
SWAT enables you
to use a Web browser as the interface to /etc/smb.conf and makes the necessary
modifications to this file.
4)
The smb.conf file
is divided into several sections, Each section contains a list of options and
values in the format:
option = value
some of them are :
option = value
some of them are :
5)
[global] :smbqq
The first section of the smb.conf file is the [global] section.
There are various option available with variety of respective values.
Example :
The first section of the smb.conf file is the [global] section.
There are various option available with variety of respective values.
Example :
[global]
workgroup = ONE
Explanation :
This is global section and has value workgroup.
Explanation :
This is global section and has value workgroup.
workgroup = ONE is the name of the workgroup shown in the identification tab of the network properties box on the Windows computer.
6)
[homes]
[homes], is used to enable the server to give users quick access to their home directories.
Example :
[homes]
comment = Home Directories
read only = No
Explanation :
comment = Home Directories is a comment line which has purpose of user understanding.
read only = No specifies that users can write to their directories.
comment = Home Directories is a comment line which has purpose of user understanding.
read only = No specifies that users can write to their directories.
7)
[printers] :
This section sets the options for printing.
This section sets the options for printing.
Example :
[printers]
path = /var/spool/samba
Explanation :
path = /var/spool/samba is the location of the printer spool directory.
Explanation :
path = /var/spool/samba is the location of the printer spool directory.
Note
:
Spool
Directory : spool refers to the process of placing data in a
temporary working area for another program to process. The most common use is
in writing files on a magnetic tape or disk and entering them in the work queue
(possibly just linking it to a designated folder in the file system) for
another process.
Spooling is useful because devices access data at
different rates. Spooling allows one program to assign work to another without
directly communicating with it.
Creating Samba Users
1) You can convert all of your system users to
Samba users by running the following command:
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
2) To create passwords for your users by using
the smbpasswd command and the user’s name as shown here:
[root@terry terry]# smbpasswd terry
Output:
New SMB password:
Retype new SMB password:
Password changed for user terry
[root@terry terry]# smbpasswd terry
Output:
New SMB password:
Retype new SMB password:
Password changed for user terry
Starting
Samba Server
1)
The
last step in samba server is to start samba daemon, the command to start is :
smb start
smb start
2)
Example
[root@terry terry]# /sbin/service smb start
O/P
Starting SMB services: [OK]
Starting SMB services: [OK]
[root@terry terry]# /sbin/service smb start
O/P
Starting SMB services: [OK]
Starting SMB services: [OK]
Connecting to samba client:
1)
We
can connect our system to other system running on SMB protocol.
2)
All
Microsoft OS use SMB protocol for communication, but it is not necessary that
we could only connect to Microsoft networks rather whichever computer supports
SMB protocol we can connect to it.
3)
In
order to make connection linux machine should be configured with samba server.
4)
We
can connect to other computer by two methods, either by smbclient utility or by smbmount
command.
5)
smbclient
i)
You can log in to any windows PC from RED Hat system.
ii)
You
will prompted
for a password to log in and will get some information
about the windows system.
iii)
Syntax
: [root@terry
terry]#smbclient//computer name/sharename
iv)
Example
:- [root@terry
terry]# smbclient //terrycollings/c
6)
smbmount
i)
Another way to make the files on the samba
client accessible on your RED HAT system is mount the client file
system on your file system.
ii)
The syntax for this command is :
smbmount//computer name/directory/mysystem/mount/point
smbmount//computer name/directory/mysystem/mount/point
iii)
Example
[root@terry terry]# smbmount //terrycollings/c /mnt/windows
O/P : Password:
[root@terry terry]# smbmount //terrycollings/c /mnt/windows
O/P : Password:
iv)
You can change to the directory on the system
where you mounted the windows system.
[root@terry terry]# cd /mnt/windows
[root@terry terry]# cd /mnt/windows
Connecting from a windows PC to the samba
Server
1.
After
configuring samba and starting samba daemon you are ready to test your
connection on the Windows PC.
2.
For
systems running Windows 2000 or XP, no configuration is required.
3.
On
the Windows computer, Double-click the My Network Places icon from the desktop.
4.
In
the Network Places window, you should now see a listing for the Red Hat
computer.
Comments