Skip to content

Commit 3042677

Browse files
committed
Add SSH during build
1 parent 0f657a3 commit 3042677

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Dockerfile.template

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ RUN apt-get update \
3535
postgresql-$PG_MAJOR=$PG_VERSION \
3636
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3737
&& rm -rf /var/lib/apt/lists/*
38+
39+
#SSH
40+
RUN apt-get -y install openssh-server
41+
RUN mkdir /var/run/sshd
42+
RUN sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config
43+
44+
#keys
45+
RUN mkdir -p /root/.ssh
46+
RUN chmod 700 /root/.ssh
47+
RUN chown root:root /root/.ssh
48+
#cp /provision/keys/insecure_key.pub /root/.ssh/authorized_keys
49+
RUN chmod 600 /root/.ssh/authorized_keys
3850

3951
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4052

0 commit comments

Comments
 (0)