« Atelier SysRes SE2a5 2023/2024 E2 » : différence entre les versions

De wiki-se.plil.fr
Aller à la navigation Aller à la recherche
Ligne 17 : Ligne 17 :
=== 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 -
</syntaxhighlight><syntaxhighlight>
</syntaxhighlight><syntaxhighlight>
dd if=/dev/zero of=toto bs=1024k count=10240
dd if=/dev/zero of=toto bs=1024k count=10240

Version du 17 septembre 2023 à 16:50

IP : 172.26.145.112

13/09/2023 :

Création de la VM

xen-create-image --hostname=berlin --ip=172.26.145.112 --dir=/usr/local/xen --dhcp
  • vi /etc/network/interfaces : remplacer DHCP par static

address 172.26.145.112/24

gateway 172.26.145.254

14/09/2023 :

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

18/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

Configuration du ssh

nano /etc/ssh/sshd_config

PermitRootLogin yes