FEATURE: change login directory to discourse home when enter a container
[discourse_docker.git] / templates / sshd.template.yml
index ac48523584fccaf9ef0f9a7700778e2c5810bcf9..5b7f4b1a7ff641ce03b0571ab107515acc6b3e98 100644 (file)
@@ -9,6 +9,12 @@ env:
 
 run:
 
+  - replace:
+      filename: /etc/pam.d/sshd
+      from: "session    required     pam_loginuid.so"
+      to: ""
+
+
   - file:
      path: /etc/service/sshd/run
      chmod: "+x"
@@ -17,10 +23,29 @@ run:
         exec 2>&1
         exec /usr/sbin/sshd -D -e
 
+  - file:
+     path: /etc/runit/3.d/99-ssh
+     chmod: "+x"
+     contents: |
+       #!/bin/bash
+       sv stop sshd
+
   - exec:
       hook: sshd
       cmd:
         - mkdir -p /var/run/sshd
         - mkdir -p /root/.ssh
         - echo "$ssh_key" >> /root/.ssh/authorized_keys
+        - echo "$$ENV_SSH_PUB_KEY" >> /root/.ssh/authorized_keys
         - chmod 640 /root/.ssh/authorized_keys
+        - rm /etc/update-motd.d/00-header
+        - rm /etc/update-motd.d/10-help-text
+        - rm /etc/legal
+  - file:
+     path: /etc/update-motd.d/00-discourse
+     chmod: +x
+     contents: |
+        #!/bin/sh
+        echo
+        echo Welcome to Discourse Docker
+        echo