Ubuntu 7.10 (Gutsy Gibbon) Samba Standalone Server With tdbsam Backend

Want to support HowtoForge? Become a subscriber!
 
Submitted by till (Contact Author) (Forums) on Mon, 2007-11-12 19:20. :: Ubuntu | Samba | Storage

Ubuntu 7.10 (Gutsy Gibbon) Samba Standalone Server With tdbsam Backend

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

This tutorial explains the installation of a Samba fileserver on Ubuntu 7.10 and how to configure it to share files over the SMB protocol as well as how to add users. Samba is configured as standalone server, not as a domain controller. For this setup, I will use the Ubuntu Server installation CD but the same installation procedure will work on an Ubuntu desktop as well.

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

 

Installing Samba

Connect to your server on the shell, or open a shell window if your Ubuntu server has a desktop installed. To become root user, execute this command:

sudo su

and enter the password of the user that you created during Ubuntu installation.

Install the Samba packages:

apt-get install libcupsys2 samba samba-common

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.

Close the file and restart Samba:

/etc/init.d/samba restart

 

Adding Samba Shares

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

If all users shall be able to read and write to their home directories via Samba, add the following lines to /etc/samba/smb.conf:

[homes]
   comment = Home Directories
   browseable = no
   valid users = %S
   writable = yes
   create mask = 0700
   directory mask = 0700

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

Set a password for tom in the Linux system user database. If the user tom shall not be able to login to the Linux system, skip this step.

passwd tom

-> Enter the password for the new user

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 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 Cynthia (not registered) on Fri, 2008-11-07 18:00.
Thanx Till Brehm , the best tutorial of this kind I found in a week. For a newbie like me it was a breeze.
Submitted by Tyler Oderkirk (registered user) on Sat, 2008-03-22 03:23.

Some clarification:

To access "tom's" home share, you'll want to visit \\192.168.1.88\tom where 192.168.1.88 is your Gutsy Samba server's IP address.

via smb.conf(5)