File tree 2 files changed +12
-13
lines changed
2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,10 @@ RUN apt-get update
16
16
17
17
# Install git
18
18
RUN apt-get install -y \
19
- git \
20
19
sed \
21
- ca-certificates \
22
20
openssh-client \
23
21
openssh-server \
24
- && update-ca-certificates
22
+ vim
25
23
26
24
# Clean up packages: Saves space by removing unnecessary package files and lists
27
25
RUN apt-get clean
@@ -42,18 +40,15 @@ RUN mkdir -p /home/sysadmin/.ssh && \
42
40
# Create privilege separation directory for SSH
43
41
RUN mkdir -p /run/sshd
44
42
45
- # Follows the instructions here:
46
- # https://ovh.github.io/the-bastion/installation/basic.html
47
- RUN git clone https://github.com/ovh/the-bastion /opt/bastion
48
- RUN git -C /opt/bastion checkout $(git -C /opt/bastion tag | tail -1)
49
- RUN /opt/bastion/bin/admin/packages-check.sh -i
50
- RUN /opt/bastion/bin/admin/install --new-install
43
+ # Update SSH configuration to disable password authentication
44
+ RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && \
45
+ sed -i 's/#PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config && \
46
+ echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config && \
47
+ echo "GatewayPorts yes" >> /etc/ssh/sshd_config
51
48
52
- # Allow SSH jumping
53
- RUN sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/' /etc/ssh/sshd_config
54
49
55
50
# Expose SSH port
56
51
EXPOSE 22
57
52
58
- # Start SSH service
59
- ENTRYPOINT ["/opt/bastion/docker/entrypoint.sh " ]
53
+ # Start the SSH daemon
54
+ CMD ["/usr/sbin/sshd" , "-D " ]
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ services:
102
102
- ./sysadmin-ssh-keys/rsa_sysadmin.pub:/home/sysadmin/.ssh/id_rsa.pub:ro
103
103
- ./sysadmin-ssh-keys/rsa_sysadmin.pub:/home/sysadmin/.ssh/authorized_keys:ro
104
104
- ./bastion/etc-bastion-config/config:/home/sysadmin/.ssh/config:ro
105
+
106
+
105
107
volumes :
106
108
db-data :
107
109
name : db-data
@@ -111,5 +113,7 @@ volumes:
111
113
networks :
112
114
dev-backend :
113
115
name : dev-backend
116
+ driver : bridge
117
+
114
118
dev-frontend :
115
119
name : dev-frontend
You can’t perform that action at this time.
0 commit comments