Debian 4.0 (Etch) Samba Standalone Server With tdbsam Backend

Want to support HowtoForge? Become a subscriber!
 
Submitted by till (Contact Author) (Forums) on Fri, 2007-04-20 19:14. :: Debian | Samba | Storage

Debian 4.0 (Etch) Samba Standalone Server With tdbsam Backend

Version 1.0
Author: Till Brehm <t.brehm [at] projektfarm [dot] com>
Last edited 04/13/2007

This tutorial explains the installation of a Samba file server on Debian Etch and how to configure it to share files over the SMB protocol as well as adding users. Samba is configured as a standalone server, not as a domain controller. To configure Samba as a domain controller, have a look at this howto: http://www.howtoforge.com/samba_domaincontroller_setup_ubuntu_6.10

In the resulting setup, every user has its own home directory that is accessible via SMB protocol and all users have a shared directory with read/write access.

Installing Samba

Install the Debian Samba packages:

apt-get install libcupsys2 samba samba-common

Answer the following questions:

Please specify the workgroup you want this server to appear to be in when queried by clients. Note that this parameter also controls the domain name used with the security=domain setting.

Workgroup/Domain Name:

-> workgroup

If your computer gets IP address information from a DHCP server on the network, the DHCP server may also provide information about WINS servers ("NetBIOS name â servers") present on the network. This requires a change to your smb.conf file so that DHCP-provided WINS settings will automatically be read from /etc/samba/dhcp.conf.

The dhcp3-client package must be installed to take advantage of this feature.

Modify smb.conf to use WINS settings from DHCP?

-> no

Edit the smb.conf file:

vi /etc/samba/smb.conf

In the global section, remove the ";" at the front of the line security = user so it looks like this:

security = user

to enable Linux system users to log in to the Samba server.

In the section [homes] change writable = no to:

writable = yes

Close the file and restart Samba:

/etc/init.d/samba restart

Now I will add a share that is accessible by all users.

Create the directory for sharing the files and change the owner to the users group.

mkdir -p /home/shares/allusers
chown -R root:users /home/shares/allusers/
chmod -R ug+rwx,o+rx-w /home/shares/allusers/

At the end of the file /etc/samba/smb.conf add the following lines:

[allusers]
  comment = All Users
  path = /home/shares/allusers
  valid users = @users
  force group = users 
  create mask = 0660
  directory mask = 0771
  writable = yes

Now we restart Samba:

/etc/init.d/samba restart

Adding And Managing Users

In this example, I will add a user named tom. You can add as many users as you need in the same way, just replace the username tom with the desired username in the commands.

useradd tom -m -G users

Now add the user to the Samba user database.

smbpasswd -a tom

-> Enter the password for the new user

Now you should be able to log in from your Windows workstation with the file explorer using the username tom and the chosen password and store files on the Linux server either in tom's home directory or in the public shared directory.

Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by sdsurid500 (registered user) on Fri, 2009-04-03 01:46.

I appreciate the examples and details in the how to, this worked well for me on Lenny. Great work!


 

Submitted by Glen (not registered) on Mon, 2008-11-10 00:11.

First how-to that actually worked - well done.