diff --git a/ssh/rootfs/etc/s6-overlay/s6-rc.d/init-user/run b/ssh/rootfs/etc/s6-overlay/s6-rc.d/init-user/run index f62c19014..83cf510e0 100755 --- a/ssh/rootfs/etc/s6-overlay/s6-rc.d/init-user/run +++ b/ssh/rootfs/etc/s6-overlay/s6-rc.d/init-user/run @@ -52,6 +52,9 @@ echo "export SUPERVISOR_TOKEN=\"${SUPERVISOR_TOKEN}\"" \ >> "${HOME_ASSISTANT_PROFILE_D_FILE}" \ || bashio::exit.nok 'Failed to export Supervisor API token' +echo "SUPERVISOR_TOKEN=${SUPERVISOR_TOKEN}" > /data/.ssh/environment \ + || bashio::exit.nok 'Failed to set Supervisor API token in env' + # Sets up the users .ssh folder to be persistent if ! bashio::fs.directory_exists "${SSH_USER_PATH}"; then mkdir -p "${SSH_USER_PATH}" \ diff --git a/ssh/rootfs/etc/ssh/sshd_config b/ssh/rootfs/etc/ssh/sshd_config index abdadf7b5..d6c7b2d29 100644 --- a/ssh/rootfs/etc/ssh/sshd_config +++ b/ssh/rootfs/etc/ssh/sshd_config @@ -44,7 +44,7 @@ AuthorizedKeysFile /etc/ssh/authorized_keys ~/.ssh/authorized_keys # Environment # =================== -PermitUserEnvironment no +PermitUserEnvironment SUPERVISOR_TOKEN # Forwarding / Tunnel # =================== diff --git a/ssh/rootfs/etc/sudoers.d/ssh-agent-env b/ssh/rootfs/etc/sudoers.d/ssh-agent-env index a58bdce1c..1e7ec0c67 100644 --- a/ssh/rootfs/etc/sudoers.d/ssh-agent-env +++ b/ssh/rootfs/etc/sudoers.d/ssh-agent-env @@ -1 +1,2 @@ -Defaults env_keep += SSH_AUTH_SOCK \ No newline at end of file +Defaults env_keep += SSH_AUTH_SOCK +Defaults env_keep += SUPERVISOR_TOKEN \ No newline at end of file