logo.png

LOCALES
DATE
CRON

SSH
IPTABLES

BIND9
EXIM4

RAID
NFS
RSYNC

HOBBIT
ROOTKITS

APACHE2
MYSQL
LDAP

MULE
APT

DEBIAN
GENTOO
UBUNTU

XORG

LIVE CD

Home Up


Contents


Memo des configurations des serveurs sous DEBIAN.


1 Serveur maison


1.1 Profile

Fichier  root/.bashrc

export EDITOR=/usr/bin/vi
export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#export TMOUT=300

Fichier  root/.bashrc

force_color_prompt=yes
...
# crypt
encrypt() {
        gpg -c $1 && rm $1
}
decrypt() {
        [ ${1%.gpg} != $1 ] || return
        gpg -d $1 > ${1%.gpg} 2>/dev/null && rm $1
}

export EDITOR=/usr/bin/vi

Fichier /etc/ssh/sshd_config

PermitRootLogin without-password


1.2 PPP

# apt-get install ppp ppoeconf
# pppoeconf

Fichiers modifiés (automatiquement) :

  • /etc/ppp/chap-secrets
  • /etc/ppp/pap-secrets
  • /etc/ppp/resolv.conf
    nameserver 80.67.169.12
    nameserver 80.67.169.40
    
  • /etc/ppp/peers/dsl-provider : les options semblent être là
  • /etc/network/interface
    auto eth0
    iface eth0 inet manual
    
    auto dsl-provider
    iface dsl-provider inet ppp
            pre-up /bin/ip link set eth0 up # line maintained by pppoeconf
            provider dsl-provider
    

Fichier à ajouter : /etc/rsyslog.d/ppp.conf

local2.*                        /var/log/ppp.log

Commandes suggérées :

# poff
# pon dsl-provider
# plog
# ip addr show ppp0


1.3 NAT

Installer le fichier /etc/network/if-pre-up.d/firewall, puis :

# ifdown dsl-priver
# ifup dsl-provider
# iptables-save


1.4 DHCP

  • # apt-get install udhcpd
    

  • /etc/udhcpd.conf
    start           192.168.2.20 
    end             192.168.2.254
    
    interface       eth1
    
    opt     dns     5.135.154.197
    option  subnet  255.255.255.0
    opt     router  192.168.2.1
    option  domain  narval.tk
    option  lease   864000          # 10 days of seconds
    

  • /etc/default/udhcpd
    DHCPD_ENABLED="yes"
    


1.5 DNS secondaire

Si le DNS secondaire ci-dessous ne permet pas de résoudre les nom de domaines extérieurs, alors mettre à l'heure le serveur et reloader bind.
Sinon, au cas où : diagramme

  • # apt-get install bind9 ntpdate
    

  • /etc/bind/name.conf.options:
    ...
            forwarders {
                    80.67.169.12;
                    80.67.169.40;
            };
    

  • /etc/bind/name.conf.local:
    include "/etc/bind/zones.rfc1918";
    
    zone "narval.tk" {
            type slave;
            file "/var/lib/bind/db.narval.tk";
            masters {
                    5.135.154.197;
            };
    };
    
    zone "5.135.154.197.in-addr.arpa" {
           type slave;
           file "/var/lib/bind/db.197.154.135.5";
            masters {
                    5.135.154.197;
            };
    };
    
    zone "79.143.250.133.in-addr.arpa" {
           type master;
           file "/etc/bind/db.133.250.143.79";
    };
    

  • /etc/bind/db.133.250.143.79:
    $TTL    604800
    @       IN      SOA     max.narval.tk. root.narval.tk.       (
                          2014061201
                            604800
                             86400
                           2419200
                            604800 )
    
    @       IN      NS      ns2.narval.tk.
    
    133     IN      PTR     evo.narval.tk.
    


2 Clavier

# apt-get install console-tools
# loadkeys fr


3 Wifi

  • Fichier /etc/modules
    wlan
    ath_hal
    ath_pci
    
  • Fichier /etc/network/interfaces
    auto ath0 
    iface ath0 inet static
            address 192.168.1.1
            netmask 255.255.255.0
            up iwconfig ath0 essid nroche mode master channel 11 rate auto
    


4 Environement graphique


4.1 Serveur X

# apt-get install xorg 
$ startx

Sous DEBIAN le serveur X est configuré pour ne pas écouter sur les ports TCP. Pour autoriser les oclock, xeyes et display faire xhost +, modifier le fichier /etc/gdm/gdm.conf et relancer le serveur X.

# This file overrides the default configuration settings
# /usr/share/gdm/defaults.conf
...
[security]
DisallowTCP=false
...
[servers]
[server-Standard]
name=Standard server
command=/usr/X11R6/bin/X -audit 0 
flexible=true
priority=10


4.2 BlackBox

# apt-get blackbox menu bbkeys
$ startx

Note : bbkeys n'est pas disponible sous wheezy, l'installer depuis squeeze.

Les racourcis clavier sont définis dans le fichier /etc/bbkeys/bbkeysrc.

[begin] (bbkeys configuration file)

  [keybindings] (begin keybindings)
    [chain] (Control-Mod1-W)
    ...
      [sendToWorkspace] (9) {9}
      [sendToWorkspace] (0) {10}
    [end]
    ...
    [Close]  (Mod1-F8)
    [changeWorkspace]  (Mod1-9) {9}
    [changeWorkspace]  (Mod1-0) {10}
    [Execute]  (Mod1-F1) {xterm}
    [Execute]  (Mod1-F2) {emacs}
    [Execute]  (Mod1-F3) {iceweasel}
    [Execute]  (Mod1-F4) {icedove}
    [Execute]  (Mod1-F5) {xrefresh}
  [end] (end keybindings)
[end] (end bbkeys configuration)

L'ajout du fichier  /.xsession permet de configurer la session graphique.

#!/bin/bash

# exports valables pour les applications lancées via la session X
. ~/.bashrc 

nice -20 /usr/bin/xscreensaver &
xset -b
bbkeys &
xterm &

exec /usr/bin/blackbox


4.3 Xdm

# apt-get xdm
# /etc/init.d/xdm start


5 Applications

Fichier /etc/apt/sources.list :

# flashplugin-nonfree debian-backport-keyring
#deb http://www.backports.org/debian etch-backports main contrib
deb http://www.backports.org/debian lenny-backports main contrib

# apt-get install xscreensaver iceweasel icedove myspell-fr-gut myspell-en-gb xpdf gv
# apt-get install flashplugin-nonfree

Java run-time environnement : cf http://plugindoc.mozdev.org/linux.html

# apt-get install sun-java6-jre
$ mkdir ~/.mozilla/plugins
$ cd $!
$ ln -s /usr/lib/jvm/java-6-sun-1.6.0.12/jre/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so
Redémarer firefox et regarder ici : about:plugins


6 Gnome

  • icone d'activation/désactivation du réseau inutile
     
    # apt-get remove gnome-network-manager
    

  • Driver de la Webcam
     
    # apt-get install gspca-modules-2.6-686
    # modprobe ...
    

  • Paquet gnome-screensaver : les images sont à placer dans le répertoire  /Pictures.
  • MSN
     
    # apt-get install amsn kmess
    

  • Gnome-classic
     
    // only let gnome-failback session
    # chmod 200 /usr/share/xsessions/gnome.desktop
    

    Utilisaer le configurateur graphique (compte utilisateur / dévérouiller) pour activer la connexion automatique :

     
    $ cat /etc/gdm3/daemon.conf
    ...
    [daemon]
    AutomaticLoginEnable=True
    AutomaticLogin=nroche
    


7 Install Debian from *nix

# mkdir ~/work
# cd ~/work
# wget http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.11_all.deb
# ar -x debootstrap_1.0.11_all.deb
# cd /
# zcat root/work/data.tar.gz | tar xv
# /usr/sbin/debootstrap --arch i386 lenny /mnt/debinst http://ftp.us.debian.org/debian

??? marche pô


8 Outils

  • netstat like pour iptable
     
    # apt-get install iptstat
    

Home Up

This document is also available in PDF and PostScript format.



2018-12-06