Skip to content

Instantly share code, notes, and snippets.

@ljamel
Created June 1, 2025 13:25
Show Gist options
  • Save ljamel/c3845c21ec1747bec9b1383dc97dd9ac to your computer and use it in GitHub Desktop.
Save ljamel/c3845c21ec1747bec9b1383dc97dd9ac to your computer and use it in GitHub Desktop.
docker run -d -v /:/host/ -p 2225:22 dockette/ssh bash -c "\
adduser -D -s /bin/bash cours && \
echo 'cours:abc' | chpasswd && \
adduser -D -s /bin/bash stagiaire && \
echo 'stagiaire:azerty' | chpasswd && \
echo 'FLAG h0tel_du_t3mp' > /home/stagiaire/flag.txt && \
chmod 600 /home/stagiaire/flag.txt && \
chown stagiaire:stagiaire /home/stagiaire/flag.txt && \
echo 'stagiaire:azer' > /home/cours/note.txt && \
chmod 600 /tmp/note.txt && \
chown cours:cours /home/cours/note.txt && \
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
ssh-keygen -A && \
/usr/sbin/sshd -D"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment