Skip to content

Instantly share code, notes, and snippets.

@udkyo
Last active September 6, 2025 05:56
Show Gist options
  • Save udkyo/c20935c7577c71d634f0090ef6fa8393 to your computer and use it in GitHub Desktop.
Save udkyo/c20935c7577c71d634f0090ef6fa8393 to your computer and use it in GitHub Desktop.

Revisions

  1. udkyo renamed this gist May 11, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. udkyo created this gist May 11, 2018.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    FROM ubuntu
    RUN apt update \
    && apt install -y firefox \
    openssh-server \
    xauth \
    && mkdir /var/run/sshd \
    && mkdir /root/.ssh \
    && chmod 700 /root/.ssh \
    && ssh-keygen -A \
    && sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \
    && sed -i "s/^.*X11Forwarding.*$/X11Forwarding yes/" /etc/ssh/sshd_config \
    && sed -i "s/^.*X11UseLocalhost.*$/X11UseLocalhost no/" /etc/ssh/sshd_config \
    && grep "^X11UseLocalhost" /etc/ssh/sshd_config || echo "X11UseLocalhost no" >> /etc/ssh/sshd_
    config

    RUN echo "YOUR_PUB_KEY_HERE" >> /root/.ssh/authorized_keys

    ENTRYPOINT ["sh", "-c", "/usr/sbin/sshd && tail -f /dev/null"]