Added file ALLinONE.sh, all scripts in one file, and updated doc

This commit is contained in:
bmiast 2025-05-28 07:23:40 +00:00
parent 66864909de
commit e12ee33245
3 changed files with 73 additions and 6 deletions

View File

@ -1,5 +1,5 @@
incus create images:debian/12 dnsmasq-container
incus config set dnsmasq-container security.syscalls.intercept.mount true
incus config set dnsmasq-container security.nesting true
incus config set dnsmasq-container security.privileged true
incus start dnsmasq-container
incus create images:debian/12 deb1
incus config set deb1 security.syscalls.intercept.mount true
incus config set deb1 security.nesting true
incus config set deb1 security.privileged true
incus start deb1

View File

@ -0,0 +1,67 @@
#!/bin/bash
# Restart usługi dnsmasq w kontenerze
incus exec deb1 -- systemctl restart dnsmasq
# Włącz automatyczne uruchamianie dnsmasq przy starcie
incus exec deb1 -- systemctl enable dnsmasq
# Sprawdź status usługi dnsmasq
incus exec deb1 -- systemctl status dnsmasq
# Test DNS — nslookup
incus exec deb1 -- nslookup example.local 192.168.1.10
# Utwórz nowy kontener deb1 z obrazu Debian 12
incus create images:debian/12 deb1
# Konfiguracja bezpieczeństwa dla kontenera deb1
incus config set deb1 security.syscalls.intercept.mount true
incus config set deb1 security.nesting true
incus config set deb1 security.privileged true
# Uruchom kontener deb1
incus start deb1
# Aktualizacja pakietów w kontenerze deb1
incus exec deb1 -- apt update
# Instalacja potrzebnych pakietów
incus exec deb1 -- apt install -y \
netplan.io \
sudo vim nano git tmux mc zip unzip curl wget htop lynx \
iproute2 termshark bridge-utils \
python3 python3-ipython python3-pyroute2 python3-scapy \
docker.io docker-compose
# Ustaw hasło root
incus exec deb1 -- bash -c 'echo "root:passroot" | chpasswd'
# Dodaj użytkownika "user" z hasłem "pass" i grupą "sudo" i " docker" (opcja dla wewnątrz kontenera i z ns1
# Wariant ns1
sudo incus exec deb1 -- su - sudo useradd -m -s /bin/bash -G sudo,docker user && echo 'user:pass' | sudo chpasswd
# Wariant inside container
sudo useradd -m -s /bin/bash -G sudo,docker user && echo 'user:pass' | sudo chpasswd
# Wejście do powłoki bash w kontenerze (opcjonalne)
incus exec deb1 -- bash -c "echo 'Wchodzimy do bash...'; exec bash"
# Aktualizacja pakietów ponownie
incus exec deb1 -- apt update
# Instalacja dnsmasq
incus exec deb1 -- apt install dnsmasq -y
# Edycja konfiguracji Netplan
incus exec deb1 -- nano /etc/netplan/01-netcfg.yaml
# Zastosowanie zmian konfiguracji sieciowej
incus exec deb1 -- netplan apply
# Edycja konfiguracji dnsmasq.conf
incus exec deb1 -- nano /etc/dnsmasq.conf
echo "Skrypt zakończony."
#made by mbiast and babcia (siah)

View File

@ -1 +1 @@
t8:37b0111174ee4067a3c1c27dace2f4874d3f0860
da086cb72f6790bee9fc30d03577587f44afbb7f