File tree 3 files changed +11
-8
lines changed
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ RUN mkdir -p /home/sysadmin/.ssh && \
28
28
# Create privilege separation directory for SSH
29
29
RUN mkdir -p /run/sshd
30
30
31
+ # Configure SSH for agent forwarding and secure settings
32
+ RUN echo "AllowAgentForwarding yes" >> /etc/ssh/sshd_config && \
33
+ echo "PermitRootLogin prohibit-password" >> /etc/ssh/sshd_config && \
34
+ echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
35
+ echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config
36
+
31
37
# Expose SSH port
32
38
EXPOSE 22
33
39
EXPOSE 3306
@@ -37,4 +43,4 @@ COPY ./db/startupservice.sh /startupservice.sh
37
43
RUN chmod +x /startupservice.sh
38
44
39
45
ENTRYPOINT ["/startupservice.sh" ]
40
- CMD ["mariadbd" ]
46
+ CMD ["mariadbd" ]
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ set -o nounset
6
6
E0=" $( printf " \e[0m" ) " # reset
7
7
E1=" $( printf " \e[1m" ) " # bold
8
8
9
- # Start SSH service
10
- /usr/sbin/sshd -D
11
-
12
9
echo " ${E1} Starting mariadb: http://127.0.0.1:3306${E0} "
13
10
14
11
# Start mariadb in the background
15
- docker-entrypoint.sh " $@ "
12
+ docker-entrypoint.sh " $@ "
13
+
14
+ # Start SSH service
15
+ /usr/sbin/sshd -D
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ services:
92
92
dockerfile : bastion/Dockerfile
93
93
networks :
94
94
- dev-backend
95
- - dev-frontend
96
95
expose :
97
96
- 22/tcp
98
97
ports :
@@ -115,5 +114,3 @@ networks:
115
114
name : dev-backend
116
115
driver : bridge
117
116
118
- dev-frontend :
119
- name : dev-frontend
You can’t perform that action at this time.
0 commit comments