Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM debian:latest
- # Install packages
- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
- openssh-server \
- apt-utils \
- python3\
- zip \
- unzip \
- sudo
- RUN mkdir -p /var/run/sshd && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config \
- && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
- && touch /root/.Xauthority \
- && true
- ## Set a default user. Available via runtime flag `--user deploy`
- ## Add user to 'staff' group, granting them write privileges to /usr/local/lib/R/site.library
- ## User should also have & own a home directory, but also be able to sudo
- RUN useradd deploy \
- && passwd -d deploy \
- && mkdir /home/deploy \
- && chown deploy:deploy /home/deploy \
- && addgroup deploy staff \
- && addgroup deploy sudo \
- && true
- RUN mkdir -p /root/.ssh
- RUN echo "ssh-rsa <your-key-here>" >> /root/.ssh/authorized_keys
- RUN chmod 600 -R /root/.ssh
- EXPOSE 22
Add Comment
Please, Sign In to add comment