Spaces:
Runtime error
Runtime error
File size: 636 Bytes
0e119f2 a6b814b 0e119f2 a6b814b 0e119f2 a6b814b b39a727 14d4f5a 4215b03 d9d3409 0e119f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# Use ubuntu as the base image
FROM ubuntu
# Install and enable SSH service
RUN apt-get update && apt-get install -y openssh-server
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# Set a password for the root user
RUN echo "root:Changeme" | chpasswd
# Create the sshuser account lol
RUN useradd -m -s /bin/bash sshuser
# Create and change ownership of the /run/sshd directory
USER root
RUN mkdir /run/sshd
RUN chown sshuser:sshuser /run/sshd
USER sshuser
# Expose the SSH port
EXPOSE 22
# Start the SSH service and run bash as the foreground process
ENTRYPOINT service ssh start && bash |