Main Index

last changed 2002-03-28

Description: Samba

What is Samba - it is an Windows NT file and print server emulator running under Linux , and which makes Windows clients

think, they are running against Windows NT server.

This is not the only way you can setup Samba , there is a lot of ways to do it , - I choose this simple way to do it .


Before this Samba server I made the web-server setup where I defined "primary name + domain" = SEINDAL.COM

The Samba server is seen in Windows as SEINDAL under LXDOMAIN so I think that the primary name is taken for that .......

Installation instruktions

Samba comes with Mandrake Linux - after doing the server installation.

Here are the things to be concerned about when you should setup Samba in a simpel configuration.

Here is what I did to setup a very simple configuration , - there are other ways to do it , this is an easy way

without DNS and with Netbios over TCP/IP and it works fine in my installation:


1) Make all the Linux users (user accounts) that you need - you could do it with ... linuxconf with has a nice user interface - the are to types of users , remember that.

a) Ordinary linux users

b) Machine accounts (also users) , witch has be be added to /etc/passwd with an text editor , yes

you understod it the right way.

I added the following 8 workstation names , 8 was to much for my configuration but I didn't want to

add more machine account/users in the future.

Add the following statements to the /etc/passwd file:

WS1$:*:801:800:Arbejdsstation 1:/dev/null:/bin/false

WS2$:*:802:800:Arbejdsstation 2:/dev/null:/bin/false

WS3$:*:803:800:Arbejdsstation 3:/dev/null:/bin/false

WS4$:*:804:800:Arbejdsstation 4:/dev/null:/bin/false

WS5$:*:805:800:Arbejdsstation 5:/dev/null:/bin/false

WS6$:*:806:800:Arbejdsstation 6:/dev/null:/bin/false

WS7$:*:807:800:Arbejdsstation 7:/dev/null:/bin/false

WS8$:*:808:800:Arbejdsstation 8:/dev/null:/bin/false


2) Make the Samba users with the same names as the linux user accounts , users with must exists before making the samba users.

Remeber it should be the ordinary linux users as well as the machine acounts/users.

Linux user:

Add new linux user in this way - in --> /etc/samba/smbpasswd

Command : add new Linux Samba user -> smbpasswd -a <newuser>

This command will prompt you for the new password.

Linux Machine acounts/users:

Give samba command for every machine --> smbpasswd -a -m WS1 (in this case 8)

This command will prompt you for the new password.


(... and maybe delete old users - sometimes

command : delete old user -> smbpasswd -x <olduser>)


3) Make the configuration file for Samba in /etc/samba/smb.conf , you can use the statements from the

"Configuration file" section below.

Configuration file:

This should be your smb.conf file . Download

# Samba config file

# from localhost.localdomain (


# change log

# Date: 2002/03/08 Installed and customized


# Global parameters


workgroup = lxdomain

server string = Samba Server %v

host allow = 192.168.1. 127.

client code page = 850

character set = ISO8859-1

printcap name = lpstat

load printers = yes

printing = cups

log file = /var/log/samba/log.%m

max log size = 100

encrypt passwords = yes

os level = 65

ecurity = shared

preferred master = true

domain master = true

dns proxy = no

username map = /etc/samba/smbusers


comment = Public Stuff

path = /home/public

public = yes

writable = no

write list = root, @root


comment = home/%U on %L

read only = no

browseable = no

writable = no

write list = root, @root


comment = www on %L

path = /var/www

read list = rbs, uls, khs, jhs

read only = no

writable = no

write list = root @root


comment = html/%U on %L

path = /var/www/html/%U

valid users = %U

read only = no

write list = %U, root, @root


comment = All Printers

path = /var/spool/samba

guest ok = yes

printable = yes

create mode = 0700

print command = lpr-cups -P %p -o raw %s -r

lpq command = lpstat -o %p

lprm command = cancel %p-%j


comment = Temporary file space

path = /tmp

guest ok = yes

writable = yes


4) Window clients - make them ready:

Go to network into TCP/IP, properties and ensure the following conditions are meet.

DNS + WINS should be deactivated.

IP address should be set to automatic

NETBIOS over TCP/IP should be flagged as on

Go to network into Identificaton

Computer name should be : WS1 or WS2 ...........

Workgroup should be lxdomain

Computerdescription could be anything I use user-name


5) This should be your LMHOSTS file : Download

# File for machine : WS1 ,
# W95/98/ME file have to be renamed to : C:\WINDOWS\LMHOSTS
# NT file have to be renamed to : C:\WINNT\DRIVERS\ETC\LMHOSTS
# DOM: xxxxxxxx is Samba Workgroup name definet in /etc/samba/smb.conf
# Change: 2002-03-16 File Customized
# WS1 #PRE #DOM:lxdomain #net linux server


6) You are now ready to use Samba as server for your network ... have fun.