Versão avaliada: Debian 11
Realizar a instalação do sistema operacional - VOL
The Debian Administrator's Handbook/ServidorDebian ou em português.
Pós instalação realizar atualização:
# apt-get update && apt-get upgrade -y -q
Instalar os pacotes abaixo:
# apt-get install vim ssh libaio1 ntpdate apt-transport-https
Remova os pacotes:
# apt-get remove --purge nano wget curl
Sistema:
# touch updatesystem
# chmod 755 updatesystem
# vi updatesystem
#!/bin/sh
/usr/bin/apt-get clean &> /dev/null
/usr/bin/apt-get update &> /dev/null
/usr/bin/apt-get upgrade -y -q &> /dev/null
Data/hora do sistema:
# touch updatetime
# chmod 755 updatetime
# vi updatetime
#!/bin/sh
/usr/sbin/ntpdate -s a.ntp.br || /usr/sbin/ntpdate -s b.ntp.br || /usr/sbin/ntpdate -s c.ntp.br && hwclock --systohc &> /dev/null
Adicionar os scripts ao CRONTAB:
# crontab -u root -e
*/10 * * * * /home/updatetime
30 1 * * * /home/updatesystem
<-Deixar uma linha em branco senão não executa o último comando.Ou adicione o comando:
*/10 * * * * /usr/sbin/ntpdate -s a.ntp.br || ntpdate -s b.ntp.br || ntpdate -s c.ntp.br && hwclock --systohc
30 1 * * * /usr/bin/apt-get update > /dev/null && /usr/bin/apt-get upgrade -y -q > /dev/null
<-Deixar uma linha em branco senão não executa o último comando.Nota: crontab select-editor para alterar o editor
Adicionando alias de comandos no final do arquivo bash.bashrc
# vi /etc/bash.bashrc
alias ls='ls --color'
alias la='ls -la'
Ou remova o comentário das linha abaixo
# vi ~/.bashrc
export LS_OPTIONS='--color=auto'
eval "$(dircolors)"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
# source ~/.bashrc
Habilitando recurso highlight do VIM basta descomentar a linha:
# vi /etc/vim/vimrc
syntax on
Ajustar segurança de acesso ao ssh: (OPCIONAL - Na versão avaliada essa função já esta ativada)
# vi /etc/ssh/sshd_config
LoginGraceTime 20
PermitRootLogin no
Após as configurações acima execute Reboot.
* Ajustar o arquivo hosts:
# vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 server.domain.local server
10.0.0.111 server.domain.local server
10.0.0.40 ad1.domain.local ad1
10.0.0.48 ad2.domain.local ad2
# 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
Configurando a ethernet:
# vi /etc/network/interfaces
#allow-hotplug eth0
# eth0 = rtl8169
auto eth2
iface eth2 inet static
address 10.0.0.1
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.254
# dns-* options are implemented by the resolvconf package, if installed
#dns-nameservers 10.0.0.40
#dns-search domain.local
# eth1 = bcm5703x
auto eth1
iface eth1 inet static
address 172.25.25.10
netmask 255.255.255.0
network 172.25.25.0
broadcast 172.25.25.255
# eth2 = intel 8254oem ...
Interface de rede virtual:
# vi /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.103/24
gateway 192.168.1.254
dns-nameservers 1.1.1.1 9.9.9.9
auto eth0:1
iface eth0:1 inet static
address 10.9.1.2/24
dns-nameservers 1.1.1.1 9.9.9.9
# ifup eth0:1
* Ajustando a resolução de nomes:
# vi /etc/resolv.conf
search domain.local
domain domain.local
nameserver IP_DNS1
nameserver IP_DNS2
Verificar se a versão do kernel e a mesma instalada, caso não atualizar:
# uname -r
# apt-cache search linux-headers
# apt-get dist-upgrade
# reboot
Desabilitar TCP Timestamps
# sysctl -a <- Lista todas as variaveis e seus respectivos valores
# sysctl net.ipv4.tcp_timestamps
net.ipv4.tcp_timestamps = 1
# sysctl -w net.ipv4.tcp_timestamps=0
# echo 0 > /proc/sys/net/ipv4/tcp_timestamps
# sysctl -p