SAMBA (Domaincontroller) Server For Small Workgroups With Ubuntu 7.10

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

SAMBA (Domaincontroller) Server For Small Workgroups With Ubuntu 7.10

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

This is a detailed description about setting up an Ubuntu based server (Ubuntu 7.10) to act as file- and printserver for Windows(tm) workstations in small workgroups. This howto uses the tdb backend for SAMBA to store passwords and account information. This is suitable for workgroups for up to 250 users and is easier to set up than an LDAP backend.

Installed Software:

  • Samba as domaincontroller
  • CUPS
  • Foomatic printer drivers

I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

 

Requirements

To install such a system you will need the following:

  • An Ubuntu server install CD (available here: http://www.ubuntu.com/download/)
  • An internet connection since I will describe a network installation in this document.

 

Enable The root User

Now I can log in with the username "administrator" and password I entered above. I will enable the root user first for ease of installation. You can disable it later if you want.

sudo passwd root
su

Now we are logged in as root user.

Hint: This step is optional, if you dont want to enable the root user for security reasons, plese run the command "sudo su" to switch to root without enabling the root user to log in directly.

 

Configure The Network

The Ubuntu installer has configured our system to get its network settings via DHCP, we will change that now because a server should have a static IP address. Edit /etc/network/interfaces and adjust it to your needs (in this example setup I will use the IP address 192.168.0.100):

vi /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
        script grep
        map eth0

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.0.100
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

Then restart your network:

/etc/init.d/networking restart

Edit /etc/hosts and add your new IP addresses:

vi /etc/hosts

127.0.0.1       localhost.localdomain   localhost       server1
192.168.0.100   server1.example.com     server1


# 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

 

Setting The Hostname

echo server1.example.com > /etc/hostname
/etc/init.d/hostname.sh
echo '192.168.0.100 server1.example.com' >> /etc/hosts

 

Install SSH Daemon

apt-get install ssh openssh-server

 

The Next Steps...

Now you can log in to your server with an SSH client like PuTTY ( http://www.chiark.greenend.org.uk/~sgtatham/putty/). Its easier to follow this howto if you connect to your server with PuTTY and copy and paste the commands. If you want to edit config files on the server, you can use command line editors like vi, pico or joe or use a program like WinSCP (http://winscp.net/eng/docs/lang:en) to edit the files over your SSH connection in a Windows client.

 

Quota

apt-get install quota

Edit /etc/fstab to look like this (I added ,usrquota,grpquota to the partitions with the mount point /):

vi /etc/fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=226d9304-88ca-44c0-a3e3-d1ad26cfc084 /               ext3    defaults,errors=remount-ro,usrquota,grpquota 0       1
# /dev/sda5
UUID=d824ce36-04b8-4870-83f4-f1a5037c2de4 none            swap    sw              0       0
/dev/hdc        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/           /media/floppy0  auto    rw,user,noauto  0       0

Then run:

touch /quota.user /quota.group
chmod 600 /quota.*
mount -o remount /
quotacheck -avugm
quotaon -avug

You will get a error like this when you run the command quotacheck -avugm the first time.

quotacheck: WARNING - Quotafile //quota.user was probably truncated. Cannot save quota settings...
quotacheck: WARNING - Quotafile //quota.group was probably truncated. Cannot save quota settings...

This is normal and nothing to worry about!


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 normanp (registered user) on Wed, 2008-02-06 17:51.
Please note that with the latest download of Ubuntu Server 7.10 you need to create files aquota.user and aquota.group, not quota.user and quota.group. The required filenames have changed for version 2 of quota.