toolbox start.
This commit is contained in:
47
Dev/fedora_toolbox/Dockerfile
Normal file
47
Dev/fedora_toolbox/Dockerfile
Normal file
@@ -0,0 +1,47 @@
|
||||
# Fedora alapimage használata
|
||||
FROM fedora:latest
|
||||
|
||||
# Metaadatok az image-hez
|
||||
LABEL maintainer="Your Name"
|
||||
LABEL description="Fedora-based toolbox with SSH, nmap, and other utilities."
|
||||
|
||||
# Build-time argumentum a jelszóhoz
|
||||
ARG SSH_PASSWORD
|
||||
|
||||
# Szükséges csomagok telepítése
|
||||
RUN dnf -y update && \
|
||||
dnf -y install \
|
||||
openssh-server \
|
||||
sudo \
|
||||
nmap \
|
||||
iputils \
|
||||
procps-ng \
|
||||
net-tools && \
|
||||
dnf clean all
|
||||
|
||||
# SSH host kulcsok generálása
|
||||
RUN ssh-keygen -A
|
||||
|
||||
# 'wpanda' felhasználó létrehozása és jelszó beállítása
|
||||
# A jelszót a build-time argumentumból kapja
|
||||
RUN useradd -m -s /bin/bash wpanda && \
|
||||
echo "wpanda:${SSH_PASSWORD}" | chpasswd
|
||||
|
||||
# Jelszavas SSH bejelentkezés engedélyezése
|
||||
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
|
||||
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
||||
|
||||
# 'wpanda' felhasználó hozzáadása a sudo csoporthoz jelszó bekérése nélkül
|
||||
RUN echo 'wpanda ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# Váltás a 'wpanda' felhasználóra
|
||||
USER wpanda
|
||||
|
||||
# Munkakönyvtár beállítása a felhasználó home könyvtárára
|
||||
WORKDIR /home/wpanda
|
||||
|
||||
# Az SSH port (22) megnyitása
|
||||
EXPOSE 22
|
||||
|
||||
# Az SSH szerver indítása előtérben
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
Reference in New Issue
Block a user