Written By:
Ying Zhang
Getting Samba
As of this writing, the latest stable version of Samba is 2.0.6. You will
need the source distribution, it is called samba-2.0.6.tar.gz, grab it
from the Samba homepage (http://www.samba.org).
Installing Samba
First thing to do is extract the source distribution. Assuming you've
downloaded it to /tmp, do this (you don't need to be root yet):
$ tar -zxvf samba-2.0.6.tar.gz
If you didn't get any error messages, you should have the extracted files
in a directory called samba-2.0.6. The Samba source distribution comes
with a bunch of packaging scripts. Of particular interest is the one that
builds an RPM for us.
Let's put blind-faith into this script and run it (now you have to be
root):
$ su
# chown -R root:root samba-2.0.6
# cd samba-2.0.6/packaging/RedHat
# sh makerpms.sh
That should take a little bit of time while it builds the RPM. If that
failed then something is wrong, uh-oh time to read the Samba docs. If it
worked, these files will be created:
/usr/src/redhat/RPMS/i386/samba-2.0.6-19990228.i386.rpm
/usr/src/redhat/SRPMS/samba-2.0.6-19990228.src.rpm
Magical isn't it.
Okay, let's install this sucker:
# rpm -Uvh /usr/src/redhat/RPMS/i386/samba-2.0.6*.i386.rpm
INSTALLING SAMBA WITHOUT RPM's
Added By: RedRumJack
Okay I was helping Crash last nite via IRC installing Samba. The current
NHF was giving him errors on Slack 7.0 trying to create the RPM's. Here is
what I had him do.
Download the source.
tar -zxvf sourcefile
cd tosourcedir.
cd /docs/textdocs
vi UNIX_INSTALL.txt
(read through this file and try to get an understanding of what to do
next before proceeding)
cd back to source dir.
$ ./configure
$ make
$ su
# make install
From here on you can follow the NHF.
Wow, can things get any easier? Next we will create a new user and group,
then some directories. Then we modify a couple of files to use the Samba
Web Administration Tool (SWAT).
Creating Stuff
I can't think of a better name for this section, but what we do here is
create a bunch of user accounts, directories and files.
New User and Group
Since we are using share level security, we have to specify a guest
account. This user account will be called smbuser and it will belong to
the smb group.
All the files that Bart and Lisa write to the data and public shares will
be owned by smbuser and belong to the smb group.
If you have Linuxconf, use it to do the dirty work. Otherwise, use
groupadd and useradd to create the new accounts.
1.Create the group smb
2.Create the user smbuser, the home directory should be in /home/public
Disable login on the smbuser account since no one will actually be
logging in with that name.
Public Directory
We should already have a /home/public (since you created it just a sec
ago). It should be owned by smbuser and belong to the group smb. Since
files in this directory should always be owned by the smb group, we will
set the SGID bit on it.
Everyone will have shared read and write access to this directory as
well, so the permissions should be set like so:
# chown smbuser:smb /home/public
# chmod 2777 /home/public
Now every file that gets created in /home/public gets owned by the smb
group no matter who creates it.
Data Directory
My data directory is /home/samba/data. This should only be accessible by
certain people - those that belong to the smb group. So I set up the
directory like so:
# mkdir /home/samba
# chown smbuser:smb /home/samba
# chmod 2770 /home/samba
# mkdir /home/samba/data
# chown smbuser:smb /home/samba/data
# chmod 2770 /home/samba/data
Again notice that I set the SGID bit on these directories so that
anything created inside them get owned by the smb group.
Since I want access to this directory, I add myself to the smb group. Do
this via Linuxconf or the usermod command. Or manually edit the /etc/group
file if you feel brave :).
Check your hosts file
You should have an /etc/hosts file that maps host names to IP addresses.
Mine would look like this:
/etc/hosts
127.0.0.1 localhost localhost.localdomain
192.168.0.1 homer
192.168.0.2 bart
192.168.0.3 lisa
Create an lmhosts file
The lmhosts file maps hostnames(or IP addresses) to NetBIOS (computer)
names. Normally you would probably want the NetBIOS name and the hostname
to be the same:
# /etc/lmhosts
localhost homer
bart bart
lisa lisa
It looks a little silly doesn't it, but the thing on the left-hand side is
the hostname(or IP address) and the thing on the right is the NetBIOS
name.
1 2 3 4
[-Next Page-]
|