-
-
Save peter279k/5f297b86e1aadd248c495f6b343f4599 to your computer and use it in GitHub Desktop.
Basic container for X11 forwarding goodness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment