Skip to content

Commit

Permalink
added ssh console config
Browse files Browse the repository at this point in the history
  • Loading branch information
apefrei committed Nov 29, 2023
1 parent 3e9167e commit b56b254
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
FROM php:apache

RUN set -x \
# Install xkcd
apt -y install python3-pkg-resources python3 xkcdpass
#Start an enable SSH
COPY entrypoint.sh ./
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get install -y --no-install-recommends openssh-server \
#XKCD
&& apt-get -y install python3-pkg-resources python3 xkcdpass \
&& echo "root:Docker!" | chpasswd \
&& chmod u+x ./entrypoint.sh
COPY sshd_config /etc/ssh/

COPY index.php /var/www/html/
EXPOSE 80

EXPOSE 80 8000 2222

ENTRYPOINT [ "./entrypoint.sh" ]
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -e
service ssh start
exec gunicorn -w 4 -b 0.0.0.0:8000 app:app
12 changes: 12 additions & 0 deletions sshd_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Port 2222
ListenAddress 0.0.0.0
LoginGraceTime 180
X11Forwarding yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
MACs hmac-sha1,hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
Subsystem sftp internal-sftp

0 comments on commit b56b254

Please sign in to comment.