Archive for March, 2007

How to Install SAMBA on Slackware 11.0

Posted in Know-How on March 27, 2007 by Paulus Bayu

Samba (the Linux implementation of the Server Message Block protocol) is an Open Source suite that provides seamless file and print services to SMB/CIFS clients. Basically, it allows both Linux and Windows users to use each other’s SMB file shares as if they were a hard disk on their own machine. A mapped network drive (Windows) or a mounted smb share (Linux) can look, feel and act like your own disk space, but it’s really a disk space on some other computer somewhere on the network. Samba also provides print services for various Windows clients and can also integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a Domain Member. Moreover, it can be part of an Active Directory domain. This article will explain how to install and configure Samba on Slackware 11.0 but it should work with older Slackware builds as well.

Download and install

- Fist of all, you should check if Samba has been selected during Slackware installation. To check if you already have Samba installed, run:

CODE


less /var/log/packages/samba*


If you get a “No such file or directory” error, proceed to installing Samba, otherwise skip this section completely.

- At this time, the latest Slackware version of Samba is 3.0.23c. Click HERE to visit the Samba package info and download for Slackware-latest.
- Choose the closest mirror to you and copy the download link.
- Next:

CODE


wget http://closest.mirror.download.link/samba-3.0.23c-i486-1.tgz
installpkg samba-3.0.23c-i486-1.tgz

You now have Samba installed.

Configuration

- To configure Samba, you will first have to be logged in as root. To switch to root user, go into a terminal and run:

CODE


su -
(Enter root password)

Samba can be configured through its smb.conf file. By default, this file resides in /etc/samba. However, the first time you install Samba, that file *should* be called smb.conf-sample. The recommended way to get Samba up and running is by creating a new smb.conf file with the basic directives and later on, add new directives to suit your system and network configuration. So follow these steps:

- Move an eventual smb.conf file:

CODE


mv /etc/samba/smb.conf /etc/samba/smb.conf.OLD
(it’s ok if you get a no such file or directory error)

- Create a new file and open it up with your favorite editor (i’ll use nano)

CODE


touch /etc/samba/smb.conf
nano /etc/samba/smb.conf


- Copy/paste the following directives to the newly created Samba config file:

CODE


[global]
workgroup = WORKGROUP
server string = foo
security = user
load printers = yes
log file = /var/log/samba.%m
max log size = 50
socket options = TCP_NODELAY

[home]
comment = My Home Directory
path = /home/someuser
valid users = someuser
writable = yes


Directives explanation:

[global]
workgroup – Enter here the NT Domain Name or Workgroup Name currently set for your network.
server string – Used for showing a description related to the Linux server.
security – Sets the Authentication Mode to user. You will gain access to Linux shares only when using a username and password. (We’ll set these later).
load printers – Set this to No if there are no printers connected to the Linux server.
log files – Defines the file that will store Samba events, alerts and errors.
max log size – Sets the maximum size for the log file, in Kb.
socket options – Specifies the options set on the client socket. The TCP_NODELAY option was reported as the option that makes the biggest difference in performance for most networks.
[home]
comment – Used for showing a description related to the user share.
path – Defines the shared directory.
valid users – Sets the users (see /etc/passwd for a valid user list) allowed to access this share.
writable – Allows valid users to write to this shared directory.

- Because the Authentication Mode was set to User, you’ll now have to create a new samba user:

CODE


smbpasswd – a someuser
(Enter the new password for this user)


The ’someuser’ must be the same user as the one set in the valid users directive in smb.conf. Moreover, this user must also be a valid Linux user (has to be listed in /etc/passwd).


Run and load at boot

Samba can be started using the RC file that came with the Samba package. This RC file is called rc.samba and should reside in /etc/rc.d. However, this file *COULD* be called rc.samba.new or it could not be set as executable. To make sure everything is set up correctly and to start Samba, run the commands:

CODE


mv /etc/rc.d/rc.samba.new /etc/rc.d/rc.samba
chmod 755 /etc/rc.samba
/etc/rc.d/rc.samba start


Test the installation

First, make sure that ports 139 and 445 (both TCP and UDP) aren’t blocked by the Linux firewall. Then go to a computer in the network and open a file browser. In the address bar, write the following address (replace 10.10.0.1 with the correct Linux LAN IP):


You should be prompted by a username and a password. Enter the ones configured using smbpasswd and you should be granted access to the Samba share.

The Ten Commandments of Access

Posted in Know-How on March 24, 2007 by Paulus Bayu

windows-31-23.png

And it came to pass that the cries and lamentations of the Access newbies were heard on high by the gods of the Database, and their hearts were moved to pity for their followers. And they opened their mouths and spake, saying: “Nevermore shall the young and innocent wander witless on their journeys!

We shall provide guidance to them, yea, and to all who wish to seek the paths of wisdom.” And they caused these commandments to be written and placed before the eyes of those seeking enlightenment.

So heed the words of those who have come before you, and keep these commandments in thine heart as thou dost create thy Database application. If thou shalt only follow these commandments thy burden shall be made light and thy path shall be made straight.

1. Thou shalt design normalized tables and understand thy fields and relationships before thou dost begin.

2. Thou shalt never allow thy users to see or edit tables directly, but only through forms and thou shalt abhor the use of “Lookup Fields” which art the creation of the Evil One.

3. Thou shalt choose a naming convention and abide by its wisdom and never allow spaces in thy names.

4. Thou shalt write comments in your procedures and explain each variable.

5. Thou shalt understand error handling and use it faithfully in all thy procedures.

6. Thou shalt split thy databases.

7. Thou shalt not use Autonumber if the field is meant to have meaning for thy users.

8. Thou shalt not copy and paste other people’s code without at least attempting to understand what it does.

9. Thou shalt not use “SendKeys”, “Smart Codes” or “GoTo” (unless the GoTo be part of an OnError process) for these will lead you from the path of righteousness.

10. Thou shalt back-up thy database faithfully, working not on thy Production Database, but on the Prototype Copy, as it is right and good to do.

Thus spake the gods of the Database, and blessed be their names! And Blessed, too, are those who contribute to the Access Newsgroup – giving freely of themselves to serve those who hunger and thirst for knowledge and understanding!