My Adventures in Linux - Part 3 . Samba - File sharing between my Linux & Win98 computers

Continuing with my adventures with the Linux operating system, I felt that the next step was to allow my computers to share parts of each other's filesystem. My Linux box is basically my gateway to the Internet and learning tool, but having said that, I use Pine and Sendmail a lot on it. I frequently receive mail on it asking for documentation, resumes, references, technical notes, etc., which I keep on the Win98 machine, so I guess I was at the point where I needed file-sharing between the two computers.

I went to www.samba.org and downloaded the latest Samba source, samba-2.2.0.tar.gz. I followed the usual Linux source installation procedures, cd /samba-2.2.0,. /configure, make and then make install.

The installation created a /usr/local/ samba directory, and having read the documentation found in this directory and elsewhere on the web, I started my Samba setup.

The first thing was to create the Samba configuration file. This in earlier versions was kept in the /etc directory, but in Samba-2.2.0, the documentation clearly stated to put your smb.conf file in /usr/local/samba/lib. I used a sample smb.conf file and added or adjusted the following in this file:

Smb passwd file = /etc/smbpasswd

I used encrypted passwords because Windows 98 has encrypted passwords as a default, and I needed to match this in my Samba setup. I had to run a shell script mksmbpasswd.sh (it came along with the samba source) to copy my passwords from /etc/passwd to /etc/smbpasswd

The next part of my smb.conf file dealt with share definitions:

comment = Home Directories ; this was to allow access from the Win98 box to my user directories
browesable = yes ; So that I can browse my /home/clived directory
writeable = yes ; So that I can transfer files from my Win98 box to my Linux box. I have the option of editing these files also, while residing in my /home/clived directory, from my Win98 box

comment = All Printers
path = /var/spool/samba
guest ok = no ; I don't plan on letting guests use this yet
browesable = no
printable = yes

I then was able to setup a network printer on my Win98 box (\\SLACKWARE7_1\lp2) which means that as I add other computers to my network, they have printer access via the network. I had printer problems but setting the permissions associated with /var/spool/samba to 777 (chmod 777 /var/spool/samba) solved these all.
Next, I created a /mnt/samba directory on my linux computer as the mount point for my Win98 shared directories (at this point I am only sharing drive D:\ which has my MP3 files and my resumes, etc). The name I have given my Win 98 computer in Microsoft Neighborhood networking is CDASILVA_2. I then wrote a script (startsmb) on my Linux box to get Samba moving there. The content of this script is as follows:

#! /bin/sh
/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D
/usr/local/samba/bin/smbmount //CDASILVA_D /mnt/samba

I then tested to see if Samba and my setup was actually working by typing in an xterm as su:
# smbclient -L slackware7_1
I was asked for a password and I just hit enter and the following display confirmed my working Samba configuration:

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.2.0]
Sharename    Type                      Comment
---------     ;  ----                         -------
homes          Disk                     Home  Directories
public           Disk                     Public  Stuff
IPC$            IPC                     IPC Service (Samba Server)
ADMIN$     Disk                    IPC Service (Samba Server)
ascii              Printer                 bjc600-letter-ascii-mono
lp2                Printer                 bjc600-letter-auto-mono
lp3                Printer                 bjc600-letter-ascii-color
lp4                Printer                 bjc600-letter-auto-color
raw               Printer                 bjc600-letter-raw
root               Disk                    Home Directories

Server                          Comment
---------     ;                 -------
CDASILVA_2            MY WINDOWS BOX
SLACKWARE7_1     Samba Server

Workgroup                  Master
---------     ;                 -------
WORKGROUP          SLACKWARE7_1

As user Clived on my linux computer, I typed smbpasswd and was prompted for a password, for which I used my login password. I didn't quite understand this part, as I thought that in creating /etc/smbpasswd as mentioned above, it would include usernames and passwords from the /etc/passwd file, but I guess that was not the case. The first time I changed my clived password, to keep the linux/samba passwords in sync, I had to su and then type smbpasswd -L clived <new password>. On my Win98 computer, I created a bat file to allow me to access via Samba, on my Linux computer, my /home/clived directory. Win98 sees this directory as drive J: on its directory structure, and the contents of this bat file (sambalogin.bat) is as follows:
net use j: \\slackware7_1\clived <password

I added startsmb to my linux startup scripts, and on the Win98 computer, I run sambalogin.bat after I have had to reboot the computer. After starting both of these scripts/bat files on both computers, on the linux computer I typed /usr/local/samba/bin/smbclient -L slackware7_1 and was shown a display of my shared directories on both computers, and in My Computer screen on the Win98 computer, Drive J: was listed as listed as Slackware7_1.

This is my initial Samba setup, which should be fine for now, as I do not need to share everything between both computers.
 
 

Hosted by www.Geocities.ws

1