summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/root/etc/s6/openssh/setup7
-rw-r--r--docker/root/etc/templates/sshd_config (renamed from docker/root/etc/ssh/sshd_config)2
2 files changed, 8 insertions, 1 deletions
diff --git a/docker/root/etc/s6/openssh/setup b/docker/root/etc/s6/openssh/setup
index f8ef816a95..10d195b74f 100755
--- a/docker/root/etc/s6/openssh/setup
+++ b/docker/root/etc/s6/openssh/setup
@@ -24,6 +24,13 @@ if [ ! -f /data/ssh/ssh_host_ecdsa_key ]; then
ssh-keygen -t ecdsa -b 256 -f /data/ssh/ssh_host_ecdsa_key -N "" > /dev/null
fi
+if [ -d /etc/ssh ]; then
+ SSH_PORT=${SSH_PORT:-"22"} \
+ envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
+
+ chmod 0644 /etc/ssh/sshd_config
+fi
+
chown root:root /data/ssh/*
chmod 0700 /data/ssh
chmod 0600 /data/ssh/*
diff --git a/docker/root/etc/ssh/sshd_config b/docker/root/etc/templates/sshd_config
index 6af082c419..ba92e236e1 100644
--- a/docker/root/etc/ssh/sshd_config
+++ b/docker/root/etc/templates/sshd_config
@@ -1,4 +1,4 @@
-Port 22
+Port ${SSH_PORT}
Protocol 2
AddressFamily any