LinuxNetMag
WINDOWS or Linux, Linux or WINDOWS?
Linux and Windows
List | Home
TOC
   
LinuxNetMag #3

  Software
 MP3
Xaudio, xmms, mp3blaster
freeztag, kmp3te
 Games
TTY-Quake, Quake3Test
Descent, LDescent, DX1
Flightsimulators
 Applications
Wine: Installation and Setup
VCron, Kcrontab
Passwords with Gpasman
 Misc.
Bootlogos: Welcome2L...
[email protected] and tools
Lightspeed
  
 

Network

Alternative Web-Browser
Linpopup
VNC - Windows X-Server
Fetchmail Part II
Apache the webserver
Windows networks: Samba
Webpublishing: Sitecopy
downloadhelp Wget
Webalizer
recommended links
  
 

Hardware

HD-/Floppy- Access
Jslaunch
  
 

Misc.

Editorial
Guestbook
Mailingliste
Complete list of articles



printer-version


 

Samba Logo
With samba it is possible to share files between WINDOWS and Linux over a LAN. The Linux computer appears as a network PC on the WINDOWS-PC, just like other WINDOWS computers in the LAN. In addition, it is also possible to access the hard disk of a WINDOWS PC from your Linux machine. You just mount the WINDOWS directories (if these were designated as shared for access) and work with these as with your own files.
The configuration is much easier now, but might be complicated for new Linux users. We try to deliver a step-by-step manual and you shall have a configured samba-server at the end.


With every Linux distribution a version of samba is normally included, but if you still had an old 1.x.x version of samba you should un-install it and get a new 2.0.x package from the homepage of samba at http://de.samba.org (look for other mirrors that are closer). If you had installed a 2.0 version with your distribution, you can jump to the part where the configuration starts.

After downloading the file you decompress it to the /tmp directory using :

>> tar zxvf samba-xxxxxx.tgz -C /tmp

Then you execute the configure script in the directory /tmp/samba-xxx/src :

>> cd /tmp/samba-xxxxx/src/

If you use a kernel higher than 2.1.70, then you use :

>> ./configure --enable-smbmount

In other cases ,you just start the script with :

>> ./configure

After the script customizes everything to your system, you compile samba with :

>> make

This takes some time depending on the PC you have. If everything worked fine, you can copy samba to the directory /usr/local/ where, by default, all additional programs are placed (just very big packages like gnome, StarOffice and KDE are in /opt).

Just root has write access to /usr/local. You change to root with:

>> su

and after entering the password, you copy samba using :

>> cp -a /tmp/samba-xxxx /usr/local

Then you change into the directory and install samba :

>> cd /usr/local/samba-xxxx/source
>> make install

Samba creates the directory /usr/local/samba where it places the binaries, the configuration file and log files.

 

And now for all of you who already have installed samba, the configuration starts.

 

A configuration file has to be created in the directory /usr/local/samba/lib/ with the name "smb.conf":

>> touch /usr/local/samba/lib/smb.conf

For a test we start with a minimum configuration

  File /usr/local/samba/lib/smb.conf 
[global]
   workgroup = workgroup

[all]
path = /
read only = yes
;
; Semicolon starts a comment
; End

 
After "workgroup=" must be the same name that appears in the WINDOWS network properties as the name of the workgroup, too.

Windows-Properties

After editing the configuration file, you start samba with the commands :

>> /usr/local/samba/bin/nmbd -D
>> /usr/local/samba/bin/smbd -D

Now you switch to the WINDOWS PC and log in. Attention: You have to choose the same user name that also exists on the Linux PC!
A double-click on the "Network" button Network should open a window where you find the Linux machine. Choosing this computer opens a window with a password request. Here you enter your log-in password you used at the Linux PC. That's why the user name has to be identical on both computers.

The actual configuration allows access all files on your Linux system. Now we want to improve the settings and change the configuration file /usr/local/samba/lib/smb.conf . The following configuration should work on most systems. We did not comment all settings, but if you want to know more you should read the manual at http://de.samba.org.
 

  File /usr/local/samba/lib/smb.conf 
[global]
   workgroup = workgroup
   guest account = nobody
   keep alive = 30
   os level = 2
   security = user
   printing = bsd
   printcap name = /etc/printcap
   load printers = yes

; If you want Samba to act as a wins server, please set
; 'wins support = yes'
   wins support = no

; If you want Samba to use an existing wins server,
; please uncomment the following line and replace
; the dummy with the wins server's ip number.
;   wins server = 192.168.1.1

[local]
   path = /usr/local
   read only = yes
; Now you can find any programs at /usr/local
;  at WINDOWS, too.

[homes]
   comment = HomeDirectory
   browseable = no
   read only = no
   create mode = 0750

; The following share gives all users access to the Server's CD drive,
; assuming it is mounted under /cd. To enable this share, please remove
; the semicolons before the lines

[cdrom]
   comment = Linux CD-ROM
   path = /cdrom
;  Here you enter the path to your CD-Rom drive,
;  often /cdrom or /mnt/cdrom
   read only = yes
   locking = no

[printers]
   comment = All Printers
   browseable = no
   printable = yes
   public = no
   read only = yes
   create mode = 0700
   directory = /tmp
; Also printers can be used from WINDOWS

To activate the new configuration, you stop the nmbd and smbd daemons. Look for the PID number with :

>>ps x

Output like:
[...]
 7199  ?  S    0:00 /usr/local/samba/bin/nmbd -D
 7201  ?  S    0:00 /usr/local/samba/bin/smbd -D
[...]

and than kill both with :

>> kill NUMBER

where NUMBER is the PID-number you find in the f irst column. Then you start them again with the new configuration by typing:

>> /usr/local/samba/bin/nmbd -D
>> /usr/local/samba/bin/smbd -D

and you search the Linux PC in your WINDOWS network window. It should appear there. If not take a look into the log files /usr/local/samba/var/log.smband /usr/local/samba/var/log.nmb.

The next issue describes how you access the WINDOWS hard disk from the Linux system and describes the SWAT configuration tool.

 
print
Other issues of Linux NetMag
[ #1 | #2 | #3 | Main ]