Basic Debian Server (Etch)

Posted by Tom Willett Thu, 24 Jul 2008 18:26:00 GMT

I have some new server hardware I am putting into service and since my last round of server building the version of Debian has changed and thus the process has changed.

In order to keep notes for myself, here is the new process. This will be the first of several posts updating how I set up my servers.

Go to Debian.org to get the netinstall image. Below are the details of using the Debian NetInstall disk to get a basic server up and running.

New Debian Server 4.0 Etch

Boot the Netinstall Disk choosing a mail server.

Now login to the server through ssh.

First update your system to the latest versions. But before doing that add the line for volatile sources to /etc/apt/sourses.list

nano /etc/apt/sources.list

deb http://volatile.debian.org/debian-volatile etch/volatile main contrib non-free

aptitude update;aptitude upgrade

Now Install some basic software, note you can cut and paste the following command lines. Command lines are in bold.

aptitude install wget bzip2 rdate fetchmail unzip zip ncftp libarchive-zip-perl zlib1g-dev libpopt-dev nmap openssl lynx fileutils binutils linux-kernel-headers build-essential

aptitude install fetchmailconf ca-certificates ntp-doc ntp ntpdate joe arj lha

Note I added the joe editor as its my favorite (love those wordstar bindings) but you can substitute your favorite.

Remove some software not needed on a internet server

aptitude remove lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig

Now edit .bashrc to set things up like I expect.

Change it from:

# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "`dircolors`"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

to

# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\[\033[1;33m\]\u\[\033[1;37m\]@\[\033[1;32m\]\h\[\033[1;31m\]\w\[\033[1;36m\]\$ \[\033[0m\]'
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

Exit and relogin to see the changes

Since I use the Joe Editor and let it make backups, there can be a lot of backups around. To deal with them I have created a little batch file to remove them in any directory tree. So now we will create this little batch file

touch /usr/sbin/rmbak

Now edit that file and insert the following contents:

#!/bin/bash
echo "Deleting backup files . . ."
find . -name '*~' -print -exec rm {} \;

Make this file executable with chmod and it is ready to go.

Verify than /etc/network/interfaces and /etc/resolv.conf are correct, if not fix them.

Set the hostname

echo someserver.somehost.net > /etc/hostname
hostname -F /etc/hostname

Update some services

update-inetd --remove daytime;update-inetd --remove telnet;update-inetd --remove time;update-inetd --remove finger

update-inetd --remove talk;update-inetd --remove ntalk;update-inetd --remove ftp

Ok now we have a base system to work from.

Comments

Leave a comment

Comments