Move openssh-server from the base image to the sshd template
[discourse_docker.git] / templates / sshd.template.yml
CommitLineData
9fb5f2d3
SS
1params:
2 # SSH key is required for remote access into the container
4ae88123
SS
3 # you may also use ssh-import-id
4 ssh_key: ""
5 # so ssh-import-id works
6
7env:
8 HOME: /root
9fb5f2d3
SS
9
10run:
11
025a598b
S
12 - replace:
13 filename: /etc/pam.d/sshd
14 from: "session required pam_loginuid.so"
15 to: ""
16
17
9fb5f2d3
SS
18 - file:
19 path: /etc/service/sshd/run
20 chmod: "+x"
21 contents: |
adff6a90 22 #!/bin/bash
9fb5f2d3
SS
23 exec 2>&1
24 exec /usr/sbin/sshd -D -e
25
074f2b6a
S
26 - file:
27 path: /etc/runit/3.d/99-ssh
28 chmod: "+x"
29 contents: |
30 #!/bin/bash
31 sv stop sshd
32
9fb5f2d3 33 - exec:
8a62ef0e 34 hook: sshd
9fb5f2d3 35 cmd:
41a0de92 36 - apt -y install openssh-server
9fb5f2d3
SS
37 - mkdir -p /var/run/sshd
38 - mkdir -p /root/.ssh
edfebd9e 39 - echo "$ssh_key" >> /root/.ssh/authorized_keys
88126eba 40 - echo "$$ENV_SSH_PUB_KEY" >> /root/.ssh/authorized_keys
edfebd9e 41 - chmod 640 /root/.ssh/authorized_keys
553a4fc9
S
42 - file:
43 path: /etc/update-motd.d/00-discourse
44 chmod: +x
45 contents: |
46 #!/bin/sh
47 echo
48 echo Welcome to Discourse Docker
49 echo