Samba Setup Guide For Linux

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

http://name.crazyartzone.com/index.

a
sp
Samba Setup Guide for Linux
Home Samba as a Primary Domain Controller
The
smb.file Samba as a Primary Domain Controller for a small network is fairly
Global easy to do. If you are looking for info on setting up a large network,
Parameters or replacing an existing NT server in your network, you may want
Share to do some reading here: . We will be concentrating on a small
Parameters network setup with Windows NT and Windows 2000 pc's.
Add users
If you are using Windows 2000 with Service Pack 2, you must use
Restarting Samba 2.2.1or newer for Samba to be a domain controller for
Samba these. It is much preferable to upgrade to 2.2.7 as there are several
Windows inhancements and security fixes.
View
Samba as a As for Windows XP, one piece of advice.....if you have bought
PDC Windows XP home edition, it will not support domain logons. You
Add a Win will need to upgrade to the Pro version.
pc to the
domain Before we get started, I will be assuming that you have a more
advanced knowledge of networking Windows and Linux. If you
Samba
are not, I strongly recommend that you check here for Linux:
FAQ
Networking-Overview-HOWTO. As for the Windows pc, please
consult your windows documentation on setting the network
domain logons, logon names and passwords. For more info:
http://www.helmig.com. Also I assume you have a working Samba
server connected to your network as well. If not you, may wish to
start here

For this document I will be adding on to an existing smb.conf that


was described here, so I will not be going through and re-
explaining every line. I will only add the lines that are neccessary
for Samba to be a PDC. ( without roaming profiles, more on this to
come). They will be highlighted in green. The lines highlighted in
black, are the comments that explain. So lets get started!

# Global parameters
[global]
workgroup = home
Netbios name = samba
encrypt passwords = Yes
; this tells Samba that security level must be set to user
security = user

;Samba is the domain and local master browser.


os level = 65
preferred master = yes
domain master = yes
local master = yes
domain logons = yes
logon path = \\%n\profiles\%u

;automatically maps the home directory of the user, can be any


drive letter you want. \\samba is the Samba server netbios
name
logon drive = q:
logon home = \\saturn\%u

;neccessary share for domain controller


[netlogon]
; comment = Network Logon Service
path = /var/lib/samba/netlogon
guest ok = yes
writable = no
share modes = no

[homes]
read only = no
browseable = no

[music]
path = /data/mp3
public =yes
browseable = yes
write list = mw, jackie

[everyone]
path = /data/everyone
browseable = yes
read only = no

So that is about it for the smb.conf file, save it and exit the editor.
Now we will need to add a Windows machine account and
password to Linux and Samba.

Web Hosting by Netfirms | Free Domain Names by Netfirms


Samba Setup Guide for Linux
Home Adding a Windows machine account, and password to Linux and Samba.
The
smb.file Now that we have setup our Samba server to be a domain controller, we need to add a W
Global machine account and password to Linux and Samba. This is much the same process as a
Parameter However there a couple of different procedures to follow. So open a terminal window as
s in the following. This will add the Windows pc named saturn to Linux first , then we wi
Samba password.
Share
Parameter
s
Add users
Restarting
Samba
Windows
View
Samba as a
PDC
Add a Win
pc to the Now as you can see there is some differences, when we added the Windows pc to Linux
domain name saturn\$, this tells Linux that it is a machine, not a name. Next when we added the
Samba password, we invoked the -m, this again tells Samba that we are adding a pc, not a perso
FAQ probably noticed that it did not prompt for a password, it just added merlex$. When you
domain, Samba will read the password from your Windows password.

Now that this done, all what is left to do is restart Samba,


Now you need to setup your Windows pc for domain logins. ***Note the first time that
Samba domain from Windows, you will need to join the domain by using root as the nam
root password for the password. After rebooting, any valid user will be able to access th

So there you are, a very simplistic Samba Primary Domain Controller setup. Again, plea
mind, this is nowhere a complete setup, it is only a small demonstration of the powerful
Samba. If you like more info on this, go to www.samba.org

Top of page
Home

Web Hosting by Netfirms | Free Domain Names by Netfirms

Samba Setup Guide for Linux


Home Adding Users and Restarting Samba
The
smb.file At this stage, we are almost done. All is left to do is add a user and restart Samba. In this
Global example we are going to add user john and assign him a Linux password and a Samba password
Parameter which will be jrambo. Open your terminal window and type in the following, entering in jrambo
s as the password.
Share
Parameter
s
Add users
Restarting
Samba
Windows
View
Samba as a
PDC
Add a Win
pc to the
domain
Samba
FAQ
What this has done is created a Linux user named john with a Linux and Samba password as
jrambo. This should be the same username and password that you log onto to the Windows pc
with. When you create a new Linux user, it will automatically create a home share for this
person. In this case it will be /home/john

Now Samba has to be restarted so that all of the changes that we have made will take effect.
Open a terminal window and type in the following

Now if you followed the instructions throughout this document, Samba should be setup for file
sharing with Windows. If you logon onto Windows with the username john and password of
jrambo, you should see the shares in your network neighborhood. And if you browse to the
music share, you will find your mp3 files!
Top of page Next: Samba as Primary Domain Controller
Home

Web Hosting by Netfirms | Free Domain Names by Netfirms

Samba Setup Guide for Linux


Home Share Parameters
The
smb.file [homes] When you create a user on your Linux pc (more on this later) it
Global will automatically create a home folder for you in /home/yourusername.
Parameters Think of this as your "My Documents" for Linux.
Share
Parameters read only = no: By default Samba will always make any directory read
only for security reasons, so we need to let Samba know that we want to be
Add users
able to write to this directory.
Restarting browseable = no: defines when you map a network drive to Samba, it will
Samba map directly to your user directory ie: \\home\mw (this is my username on
Windows
View Linux and Samba) This share /homes/mw is browseable only by you.
Samba as a Remember this is much the same as the "My Documents" folder in
PDC Wndows
Add a Win
[Music] This will create a share for mp3 storage. Again lets go over the
pc to the
share parameters for this.
domain
Samba path = /data/mp3: This tells us the directory is found on the Samba server
FAQ as /data/mp3, later when we map the network drive on the Windows pc, it
will be seen as "music" in Network Neighborhood
browseable = yes: This share will show in in Network Neighborhood as
"Music"

***To make this directory open a terminal window and type in md


/data/mp3. Or this can be done from a file manager

public = yes: Specifies anyone can access and view the contents of
/data/mp3
write list = mw, Jackie: Although anyone can view and excute (meaning
see and play any mp3 in this directory). For security and practical reasons I
have set this share so that only mw (thats me)and jackie can delete or add
files. You can add as many names as you wish to this line ie:, mw, john,
tiffany etc. To exclude any person from being able to access this share
altogether, add the line: invalid users = vicky, steve. These names are the
logon names from Windows, and are not case sensitive. They also must
have a logon name and Samba password on the Linux pc.

In order for Samba to accomplish all this we need to set certain Linux file
permissions such as these. This can be done by opening your file manager
(in this case Konqueror) and right clicking on the /data/mp3 share and
choosing properties
.

[everyone] This will create a share that is viewable, and writeable by


anyone. This is not at all a secure share. Anyone can do whatever they
wish, including deleting files that are not their own. I strongly do not
recommend this type of sharing. I have given this example for illustrative
reasons only.
path = /data/everyone: This tells us the directory is found on the Samba
server as /data/everyone, and that when we will map the network drive it
will be seen as "everyone" in Network Neighborhood

***To make this directory open a terminal window and type in md


/data/everyone. Or this can be done from a file manager

read only = no: By default Samba will always make any directory read
only for security reasons, so we need to let Samba know that we want to be
able to write to this directory.
browesable = yes: This share will show in in Network Neighborhood as
"everyone"

In order for Samba to be able to allow anyone read, write access to this
share, we need to set certain Linux file permissions such as these. This can
be done by opening your file manager (in this case Konqueror) and right
clicking on the /data/everyone share and choosing properties

Top of page Next: Adding users and restarting


Home Samba

You might also like