mirror of
https://github.com/ghndrx/shellmate.git
synced 2026-02-10 14:55:08 +00:00
fix: SSH key permissions and configurable port
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -15,13 +15,14 @@ COPY src/ src/
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir .
|
||||
|
||||
# Generate SSH host key
|
||||
RUN mkdir -p /etc/shellmate && \
|
||||
ssh-keygen -t ed25519 -f /etc/shellmate/ssh_host_key -N ""
|
||||
# Create user and directories
|
||||
RUN useradd -m shellmate && \
|
||||
mkdir -p /etc/shellmate && \
|
||||
chown shellmate:shellmate /etc/shellmate
|
||||
|
||||
# Run as non-root
|
||||
RUN useradd -m shellmate
|
||||
# Switch to shellmate user and generate SSH key
|
||||
USER shellmate
|
||||
RUN ssh-keygen -t ed25519 -f /etc/shellmate/ssh_host_key -N ""
|
||||
|
||||
EXPOSE 2222
|
||||
|
||||
|
||||
Reference in New Issue
Block a user