« Atelier SysRes SE2a5 2023/2024 E2 » : différence entre les versions
Aller à la navigation
Aller à la recherche
Ligne 14 : | Ligne 14 : | ||
xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp | xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*Lancer la VM | |||
* vi /etc/network/interfaces : remplacer DHCP par static | <syntaxhighlight lang="linux-config"> | ||
xen console berlin | |||
</syntaxhighlight> | |||
*vi /etc/network/interfaces : remplacer DHCP par static | |||
<syntaxhighlight lang="linux-config"> | <syntaxhighlight lang="linux-config"> | ||
address 172.26.145.112/24 | address 172.26.145.112/24 | ||
Ligne 21 : | Ligne 24 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== '''14/09/2023 :''' == | =='''14/09/2023 :'''== | ||
=== Configuration === | === Configuration=== | ||
Configuration de l'interface:<syntaxhighlight lang="linux-config"> | Configuration de l'interface:<syntaxhighlight lang="linux-config"> | ||
nano /etc/network/interfaces | nano /etc/network/interfaces | ||
Ligne 34 : | Ligne 37 : | ||
gateway 172.26.145.254 | gateway 172.26.145.254 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Création d’un conteneur à la main === | ===Création d’un conteneur à la main=== | ||
Sous machine Zabeth:<syntaxhighlight lang="linux-config"> | Sous machine Zabeth:<syntaxhighlight lang="linux-config"> | ||
su - | su - | ||
Ligne 55 : | Ligne 58 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Docker === | ===Docker=== | ||
<syntaxhighlight> | <syntaxhighlight> | ||
docker run -i -t debian /bin/bash | docker run -i -t debian /bin/bash | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== '''02/10/2023''' == | =='''02/10/2023'''== | ||
* Configuration du ssh | *Configuration du ssh | ||
<syntaxhighlight lang="linux-config"> | <syntaxhighlight lang="linux-config"> | ||
nano /etc/ssh/sshd_config | nano /etc/ssh/sshd_config | ||
</syntaxhighlight>PermitRootLogin yes | </syntaxhighlight>PermitRootLogin yes | ||
* Installer '''apache2''' et '''bind9''' | *Installer '''apache2''' et '''bind9''' | ||
* lvcreate -L10G -nberlin-var virtual | *lvcreate -L10G -nberlin-var virtual | ||
* lvcreate -L10G -nberlin-home virtual | *lvcreate -L10G -nberlin-home virtual | ||
* tasksel (xfce) | *tasksel (xfce) | ||
== '''05/10/2023''' == | =='''05/10/2023'''== | ||
* mkfs /dev/xvdb1 | *mkfs /dev/xvdb1 | ||
* mkfs /dev/xvdb2 | *mkfs /dev/xvdb2 | ||
* mkdir new-var | * mkdir new-var | ||
* mkdir new-home | *mkdir new-home | ||
* mount /dev/xvdb1 /new-home | *mount /dev/xvdb1 /new-home | ||
* mount /dev/xvdb2 /new-var | *mount /dev/xvdb2 /new-var | ||
* mv /var/* /new-var/ | * mv /var/* /new-var/ | ||
* lsblk | *lsblk | ||
<syntaxhighlight lang="linux-config"> | <syntaxhighlight lang="linux-config"> | ||
xvda1 202:1 0 512M 0 disk [SWAP] | xvda1 202:1 0 512M 0 disk [SWAP] | ||
Ligne 91 : | Ligne 94 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* nano /etc/fstab | *nano /etc/fstab | ||
<syntaxhighlight lang="linux-config"> | <syntaxhighlight lang="linux-config"> | ||
/dev/xvdb1 /home ext2 defaults 0 2 | /dev/xvdb1 /home ext2 defaults 0 2 | ||
Ligne 98 : | Ligne 101 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* umount /root/new-var | *umount /root/new-var | ||
* umount /root/new-home | *umount /root/new-home | ||
* mount -a | *mount -a | ||
* lsblk | *lsblk | ||
<syntaxhighlight lang="linux-config"> | <syntaxhighlight lang="linux-config"> | ||
xvda1 202:1 0 512M 0 disk [SWAP] | xvda1 202:1 0 512M 0 disk [SWAP] | ||
Ligne 116 : | Ligne 119 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Séance du 10/11: === | ===Séance du 10/11: === | ||
Modification: nano /etc/bind/db.berlin2.lol<syntaxhighlight lang="linux-config"> | Modification: nano /etc/bind/db.berlin2.lol<syntaxhighlight lang="linux-config"> | ||
$TTL 1H | $TTL 1H |
Version du 16 novembre 2023 à 13:03
Informations :
IP : 172.26.145.112
Nom du domaine: berlin2.lol
Machine de service: berlin
Machine mandataire: judo
13/09/2023 :
Création de la VM
xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp
- Lancer la VM
xen console berlin
- vi /etc/network/interfaces : remplacer DHCP par static
address 172.26.145.112/24
gateway 172.26.145.254
14/09/2023 :
Configuration
Configuration de l'interface:
nano /etc/network/interfaces
Modifications:
auto eth0
iface eth0 inet static
address 172.26.145.109/24
gateway 172.26.145.254
Création d’un conteneur à la main
Sous machine Zabeth:
su -
dd if=/dev/zero of=toto bs=1024k count=10240
mkfs /home/pifou/toto
mkdir tmp/mnt
mount -oloop /home/pifou/toto /tmp/mnt
apt install debootstrap
debootstrap stable /tmp/mnt
echo "proc /proc proc defaults 0 0" >> /tmp/mnt/etc/fstab
unshare -p -f -m chroot /tmp/mnt /bin/sh -c "mount /proc ; /bin/bash"
Docker
docker run -i -t debian /bin/bash
02/10/2023
- Configuration du ssh
nano /etc/ssh/sshd_config
PermitRootLogin yes
- Installer apache2 et bind9
- lvcreate -L10G -nberlin-var virtual
- lvcreate -L10G -nberlin-home virtual
- tasksel (xfce)
05/10/2023
- mkfs /dev/xvdb1
- mkfs /dev/xvdb2
- mkdir new-var
- mkdir new-home
- mount /dev/xvdb1 /new-home
- mount /dev/xvdb2 /new-var
- mv /var/* /new-var/
- lsblk
xvda1 202:1 0 512M 0 disk [SWAP]
xvda2 202:2 0 10G 0 disk /
xvdb1 202:17 0 10G 0 disk /root/new-home
xvdb2 202:18 0 10G 0 disk /root/new-var
- nano /etc/fstab
/dev/xvdb1 /home ext2 defaults 0 2
/dev/xvdb2 /var ext4 defaults 0 2
- umount /root/new-var
- umount /root/new-home
- mount -a
- lsblk
xvda1 202:1 0 512M 0 disk [SWAP]
xvda2 202:2 0 10G 0 disk /
xvdb1 202:17 0 10G 0 disk /home
xvdb2 202:18 0 10G 0 disk /var
ajout des interfaces sur la machine de service berlin :
auto eth1
iface eth1 inet static
address 192.168.165.3/24
gateway 192.168.165.1
post-up ethtool -K eth1 tx off
Séance du 10/11:
Modification: nano /etc/bind/db.berlin2.lol
$TTL 1H
berlin2.lol. IN SOA ns1.berlin2.lol. berlin222@mail.com. (
2011041902 ; Serial
1H ; Refresh
15M ; Retry
2W ; Expire
3M ; Minimum TTL
)
berlin.lol. IN NS ns1.berlin2.lol.
berlin.lol. IN A 193.48.57.165
ns1.berlin2.lol. IN A 193.48.57.165
ns1.berlin2.lol. IN AAAA 2001:660:4401:60a0:216:3eff:fe9b:446d
www.berlin2.lol. IN CNAME ns1.berlin2.lol.