Samba Basic Hands-On Practice 3
This page is at:
http://joelandrebecca.martintribe.org/linuxconf/install/hands_on3.html
Scenario:
The Tropics travel agency has expanded significantly and now has 30 full
time employees and a part time administrator. There is now concern about
the employees modifying each other's files. Each travel agent will have a
username and password assigned to them. The part time administrator
"Mr. Master" will be able to access and modify any of the other travel
agents' documents.
For our purposes, assign each agent a password that is the same as the
username and we will only create 5 of the 30 agent accounts. We will use
the following usernames: mrmaster, agent01, agent02, ... agent05. Each
agent will have their own share. Mr. Master will be able to access other
agent's files through a "master" share that only he can access.
In the past, travel agents used their own printers on their home
computers. Now the office has installed a high capacity printer that
is to be shared by everyone.
Steps
1. Verify that cups is installed. If it isn't installed you will need to
install it via the "Add/Remove Applications" application. If cups is
installed, the following command will print out the version number of
cups that is installed on the system.
rpm -qa | grep cups
2. Add a group account for the agents to use.
groupadd agents
3. Install the new configuration for the company. Backup the
current configuration. Download the configuration and move it into
place.
cd /etc/samba
rm smb.conf
wget joelandrebecca.martintribe.org/linuxconf/samba/smb.conf.example3
cp smb.conf.example3 smb.conf
4. Edit your smb.conf to make sure to set your netbios name to
a unique name so that you won't collide with other students.
5. Create the UNIX account for Mr. Master and set his password to
"mrmaster". Don't worry if it complains about your password. As
root you can do anything. Add the user to the Samba password file
with the exact same password.
useradd -m -G agents -c "Mr. Master" mrmaster
passwd mrmaster
smbpasswd -a mrmaster
6. Create the UNIX accounts for the travel agents. Repeat the
following for all 5 agents. Make sure to set the UNIX and Samba
account passwords to exacltly the same thing.
useradd -m -G agents -c "Agent 1" agent01
passwd agent01
smbpasswd -a agent01
7. Create the directory structure for the file shares. Don't worry
if you don't understand the command. Trust me.
for i in mrmaster agent01 agent02 agent03 agent04 agent05; do
mkdir -p /data/$i
chown $i /data/$i
done
chgrp -R agents /data
chmod -R ug+rwxs,o-r+x /data
8. Your instructor will provide a command to configure the correct
CUPS printer queues for your use. The command will look something
like this:
lpadmin -p PRINTQ -v parallel:/dev/lp0 -E
9. Edit the file /etc/cups/mime.convs to uncomment the line:
application/octet-stream application/vnd.cups-raw 0 -
10. Edit the file /etc/cups/mime.types to uncomment the line:
application/octet-stream
Verification
5. Validate the syntax of the configuration file
testparm
6. Restart Samba services (smbd and nmbd) and cups services and setup
samba and cups so that they restarts everytime the machine is booted:
chkconfig smb on
chkconfig cups on
/etc/init.d/smb restart
/etc/init.d/cups restart
7. Verify that the shares are visible from the server side
smbclient -L localhost -N
smbclient -L NETBIOS_NAME -N
8. Ensure that all Windows clients are in the same network (same
netmask i.e. 255.255.255.0), and set workgroup names of all Windows
clients to the same as specified in the smb.conf configuration
file.
9. Login as mrmaster. Verify that mrmaster has full access to the
"master" share and all agent directories under it.
10. Logout and log back in as one of the agent accounts. Verify that
the agent has full access to the "files" share, but cannot access
the "master" share at all.
11. Install a printer driver and test printer sharing using the
following steps:
1. Click Start->Settings->Printers+Add Printer+Next. Do not click
Network printer. Ensure that Local printer is selected.
2. Click Next. Select the correct Manufacturer and Printer.
Click Next.
3. In the panel labeled Available ports:, select FILE:. Accept the
default printer name by clicking Next. When asked, “Would you like
to print a test page?”, click No. Click Finish.
4. You may be prompted for the name of a file to print to. If so,
close the dialog panel. Right-click PRINTER NAME->Properties.
5. In the panel labeled Network, enter the name of the print queue
on the Samba server as follows: \\SERVER\PRINTQ. Click OK+OK to
complete the installation.
6. Create a test page in Wordpad and try and print it to the printer.
7. If the page doesn't print to the print, check to see if the
job is queued on the Samba server within the cups system by
running the following command:
lpq