Samba
Samba is long for SMB which is short for Server Message Block which is also known as Windows Networking. Samba enables, among many things, a Linux machine to be a peer member of a Microsoft Windows network. This case describes the process using Ubuntu Linux.
Although it is one of the options available when installing an Ubuntu server, you can add it later with "tasksel" at the command line (Applications, Accessories, Terminal)
sudo tasksel
All the machines on the network need names and IP addresses. The simplest mechanism to mapping addresses to names is to edit the "hosts" file. On Ubuntu that file is /etc/hosts. My home network has four machines, a router and a printer. My hosts file looks like this:
root@venus:/etc# cat hosts
127.0.0.1 localhost
127.0.1.1 venus.ls.net
192.168.20.1 dd-wrt
192.168.20.2 venus
192.168.20.4 diva
192.168.20.9 hp
192.168.20.14 sandbox
192.168.20.42 hans
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
On Windows machines, the file is /windows/system32/drivers/etc/hosts. On my networks sole Windows machine it looks like this:
192.168.20.1 ddwrt
192.168.20.2 venus
192.168.20.4 diva
192.168.20.9 hp
192.168.20.14 sandbox
192.168.20.42 hans
We want to enable file shares on the Linux box compatible with Windows. This is inherently a bad idea, the security of Windows boxes sharing files is horrid. If you have a router between your network and the Internet, it will do a pretty good job of protecting you if your Windows machines are "clean". The normal rule of the firewall in a router is to permit "establlished" traffic. That is if one of your machines starts something, the router will permit a response, but an outside box cannot initiate a conversation.
Having been warned, we will now configure the Linux machine to act like a Windows client. We do that by replacing the rather large default configuration file - /etc/ samba/smb.conf with this much shorter (and vulnerable) one.
[global]
workgroup = MSHOME
netbios name = SANDBOX
security = SHARE
auth methods = guest
domain master = No
wins support = no
[samba]
path = /samba
read only = No
guest ok = Yes
available = yes
browsable = yes
public = yes
writable = yes
[tarvid]
path = /home/tarvid
available = yes
browsable = yes
public = yes
writable = yes
This file says our workgroup name is "MSHOME". That is the Microsoft default. Our netbios name is the one we mapped to an IP in the "hosts" file. The security method is "SHARE", again the method Microsoft uses and Linux purists castigate vehemently. The auth method is "guest", we will let anybody in. We don't do domain master nor wins support for the sheer sake of simplicity.
Then we declare two shares - samba and tarvid (that's my name). We need to make /samba and let anybody who can get to it do whatever they want to.
sudo mkdir /samba
sudo chmod 777 /samba
sudo is the command that lets ordinary users do things they are not really supposed to do because you can really make a muck of things this way. We make samba writable, public, browsable, available and guest can play to.
Now we can browse the Linux box from the Microsoft Box through My Network Places.
If you have any problems, post them in the forum or use the contact link on the left.













