Spaces:
Paused
Paused
BinaryONe commited on
Commit ·
6eaf352
1
Parent(s): 3d12fd6
Changes
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -22,14 +22,15 @@ RUN useradd -m -s /bin/bash admin && \
|
|
| 22 |
groupadd administrator && \
|
| 23 |
usermod -aG administrator,sudo admin
|
| 24 |
|
| 25 |
-
# Grant full sudo access to the 'administrator' group
|
| 26 |
-
RUN echo "%administrator ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
| 27 |
|
| 28 |
# Copy the application code to the container
|
| 29 |
COPY . /app
|
| 30 |
|
| 31 |
# Create necessary directories and set permissions
|
| 32 |
-
RUN mkdir -p /var/run/sshd /app /app/ssh && chmod -R 777 /app
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# Generate SSH host keys
|
| 35 |
RUN ssh-keygen -A
|
|
@@ -46,7 +47,7 @@ RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/s
|
|
| 46 |
RUN cp -r /etc/ssh/* /app/ssh && \
|
| 47 |
chmod -R 777 /etc/ssh/* /app/ssh/* && \
|
| 48 |
touch /app/ssh/ssh_known_hosts && chmod 777 /app/ssh/ssh_known_hosts
|
| 49 |
-
|
| 50 |
# List contents of /etc/ssh and /app/ssh
|
| 51 |
RUN ls -l /etc/ssh/ && \
|
| 52 |
ls -l /app/ssh/
|
|
|
|
| 22 |
groupadd administrator && \
|
| 23 |
usermod -aG administrator,sudo admin
|
| 24 |
|
|
|
|
|
|
|
| 25 |
|
| 26 |
# Copy the application code to the container
|
| 27 |
COPY . /app
|
| 28 |
|
| 29 |
# Create necessary directories and set permissions
|
| 30 |
+
RUN mkdir -p /var/run/sshd /app /app/ssh && chmod -R 777 /app /etc/sudoers
|
| 31 |
+
|
| 32 |
+
# Grant full sudo access to the 'administrator' group
|
| 33 |
+
RUN echo "%administrator ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
| 34 |
|
| 35 |
# Generate SSH host keys
|
| 36 |
RUN ssh-keygen -A
|
|
|
|
| 47 |
RUN cp -r /etc/ssh/* /app/ssh && \
|
| 48 |
chmod -R 777 /etc/ssh/* /app/ssh/* && \
|
| 49 |
touch /app/ssh/ssh_known_hosts && chmod 777 /app/ssh/ssh_known_hosts
|
| 50 |
+
|
| 51 |
# List contents of /etc/ssh and /app/ssh
|
| 52 |
RUN ls -l /etc/ssh/ && \
|
| 53 |
ls -l /app/ssh/
|