4 - Habilitando a conta root

Depois de reinicializar, você pode se logar com o o seu nome de usuário criado previamente (ex: ubuntu). Habilite a conta root agora, porque você deverá executar todos os passos deste tutorial como usuário root .

Execute

sudo passwd root

e entre com a senha do usuário root. Depois disto, torne-se root executando o comando

su


5 - Instalar o vim-full (Opcional)

Utilizarei o vi como editor de texto neste tutorial. O programa vi padrão tem algum comportamente estranho no Ubuntu e no Debian; para consertar isto, instalaremos o vim-full:

apt-get install vim-full

Você pode utilizar o editor de texto de sua preferência. Ex.: joe, nano.

6 - Configurar a rede

Já que o instalador do Ubuntu configurou o sistema para conseguir suas configurações de rede através de DHCP, você tem que mudar isto agora, porque um servidor deveria ter um endereço IP estático. Edite o arquivo /etc/network/interfaces e ajuste-o conforme as suas necessidades (nesta configuração de exemplo, utilizarei o endereço de IP 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

# 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

Então, reinicialize a sua rede:

/etc/init.d/networking restart

então, edite o arquivo /etc/hosts. Faça-o se parecer com isto:

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

Agora execute

echo server1.example.com > /etc/hostname
/etc/init.d/hostname.sh start

Depois, execute

hostname
hostname -f

Ambos devem exibir server1.example.com now.

7 - Edite o arquivo /etc/apt/sources.list e Atualize a sua instalação de Linux

Edite o arquivo /etc/apt/sources.list . Descomente ou remova a linha do CD de instalação no arquivo e assegure de que os repositórios universe e o multiverse estão habilitados. No final, o arquivo deve se parecer com isto:

vi /etc/apt/sources.list

#
# deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted

#deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://de.archive.ubuntu.com/ubuntu/ gutsy main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy universe
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy universe
deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy multiverse
deb http://de.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse

## Uncomment the following two lines to add software from the ‘backports’
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://de.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
# deb-src http://de.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical’s
## ‘partner’ repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
# deb http://archive.canonical.com/ubuntu gutsy partner
# deb-src http://archive.canonical.com/ubuntu gutsy partner

deb http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted
deb http://security.ubuntu.com/ubuntu gutsy-security universe
deb-src http://security.ubuntu.com/ubuntu gutsy-security universe
deb http://security.ubuntu.com/ubuntu gutsy-security multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse

Então, execute:

apt-get update

para atualizar o banco de dados do pacote apt e

apt-get upgrade

para instalar os últimos updates (se houver algum).

8 - Modifique a shell padrão

/bin/sh é um link simbólico para /bin/dash . Contudo, nós precisamos de /bin/bash, e não de /bin/dash . Então, faremos isto:

ln -sf /bin/bash /bin/sh

9 - Instalar alguns softwares

Agora, instalaremos alguns pacotes que serão necessários mais tarde. Execute

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

(Este comando deve ser digitado em uma linha inteira.)