The Perfect Setup - Debian Etch (Debian 4.0) - Page 3

4 Install The SSH Server

Debian Etch does not install OpenSSH by default, therefore we do it now. Run

apt-get install ssh openssh-server

You will be prompted to insert the installation CD again.

 

5 Configure The Network

Because the Debian Etch installer has configured our system to get its network settings via DHCP, we have to 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) (please note that I replace allow-hotplug eth0 with auto eth0; otherwise restarting the network doesn't work, and we'd have to reboot the whole system):

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

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
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

Then edit /etc/hosts. Make it look like this:

vi /etc/hosts
127.0.0.1       localhost.localdomain   localhost
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

Now run

echo server1.example.com > /etc/hostname

and reboot the system:

shutdown -r now

Afterwards, run

hostname
hostname -f

Both should show server1.example.com.

From now on you can use an SSH client such as PuTTY and connect from your workstation to your Debian Etch server and follow the remaining steps from this tutorial.

 

6 Edit /etc/apt/sources.list And Update Your Linux Installation

Edit /etc/apt/sources.list. Comment out the CD. It should look like this:

vi /etc/apt/sources.list
#
# deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main

#deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main

deb http://ftp2.de.debian.org/debian/ etch main
deb-src http://ftp2.de.debian.org/debian/ etch main

deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib

Then run

apt-get update

to update the apt package database and

apt-get upgrade

to install the latest updates (if there are any).

 

7 Install Some Software

Now we install a few packages that are needed later on. Run

apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev linux-kernel-headers lynx m4 make ncftp nmap openssl perl perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g++

(This command should go into one line!)

 

8 Quota

(If you have chosen a different partitioning scheme than I did, you must adjust this chapter so that quota applies to the partitions where you need it.)

To install quota, run

apt-get install quota

Edit /etc/fstab. Mine looks like this (I added ,usrquota,grpquota to partition /dev/sda1 (mount point /; your device name might be /dev/hda1 or similar)):

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       /               ext3    defaults,errors=remount-ro,usrquota,grpquota 0       1
/dev/sda5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

To enable quota, run these commands:

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

Share this page:

Suggested articles

6 Comment(s)

Add comment

Comments

By:

If you like me get the following error in step 6:

W: GPG error: http://security.debian.org etch/updates Release: Unknown error executing gpgv

Check out this page for a solution. It worked for me.

Great tutorial BTW, thanks!

 

By:

-removed. placing in the forum

By: Superkikim

ATTENTION: After apt-get upgrade, you have to reboot the server (at least in my case).

 While apt-get upgrade was running, a dialog box appeared saying ht has to recompile the kernel (?) or some modules (?), saying 4 times I'll have to reboot :-)

 So, just don't miss it. After apt-get upgrade, type reboot

 

By:

When installing Debian Etch under VMWARE, you usally use the natted interface in the first installation-parts. Then you edit the interfaces-file, add SSH-support, and change the netowrking-environment in VMWARE to use bridged networking.

SSH now works fine, but there ist no access to the internet. I have tried a lot and found out that pinging of external IPs was possible, the nameserver was the problem. I edited /etc/resolve.conf then and the nameserver was something the natted connection had left there. After choosing the correct nameserver the installation could continue without problems...

Thanks for these good Howtos, i would not be able to set up my systems without them ...

Greetings

Hartmut


By: stefan

My /etc/fstab looks way different than yours - so I'm not sure how to edit it.

Do I just go ahead and add 'usrquota,grpquota' after the word 'defaults' on the line for mount point '/'? 

I also ran the command 'uname --all' to show you the system I'm using: it's Debian 4.0 on i686 using Xen virtualization at my VPS hosting provider. 

myserver:~# uname --all
Linux
myserver 2.6.20-xen-r6 #2 SMP Wed Jan 16 19:43:41 CET 2008 i686 GNU/Linux

myserver:~# cat /etc/fstab
# Hard file systems.
/dev/hda2       /       auto    defaults        0 1
/dev/hda1       swap    swap    defaults        0 0

# Virtual file systems.
none            /proc   proc    defaults        0 0
none            /sys    sysfs   defaults        0 0

Thanks for any suggestions. 

By: Ivan Raic

...heared it already totally newbie so I get this

 Reading package lists... Done

Building dependency tree       

Reading state information... Done

Note, selecting 'perl' instead of 'libcompress-zlib-perl'

Note, selecting 'linux-libc-dev' instead of 'linux-kernel-headers'

Package libpopt-dev is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package lynx is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package fetchmail is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package autoconf is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package automake1.9 is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package libtool is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package flex is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package bison is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package unzip is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package zip is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


Package autotools-dev is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source


E: Package 'fetchmail' has no installation candidate

E: Package 'flex' has no installation candidate

E: Unable to locate package libarchive-zip-perl

E: Unable to locate package libdb4.3-dev

E: Couldn't find any package by regex 'libdb4.3-dev'

E: Package 'libpopt-dev' has no installation candidate

E: Package 'lynx' has no installation candidate

E: Unable to locate package ncftp

E: Unable to locate package nmap

E: Package 'unzip' has no installation candidate

E: Package 'zip' has no installation candidate

E: Unable to locate package zliblg-dev

E: Package 'autoconf' has no installation candidate

E: Package 'automake1.9' has no installation candidate

E: Package 'libtool' has no installation candidate

E: Package 'bison' has no installation candidate

E: Package 'autotools-dev' has no installation candidate

[email protected]:/home/velebit#