Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom scripts #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

aude
Copy link

@aude aude commented Aug 3, 2021

This change adds support for putting custom scripts in /etc/sftp.d with the sftpConfig.customScripts Helm value.

Upstream atmoz/sftp looks in /etc/sftp.d for executables and runs them.

This change adds support for putting custom scripts in `/etc/sftp.d`
with the `sftpConfig.customScripts` Helm value.

Upstream looks for executables in `/etc/sftp.d` on startup and runs
them.
@aude
Copy link
Author

aude commented Aug 3, 2021

Have been using the following script:

  ...
  customScripts:
    writable-homedirs.sh: |
      #!/bin/sh

      # make homedirs writable
      for homedir in /home/*; do
        if [ -d "$homedir" ]; then
          username=$(basename "$homedir")
          chown "$(id -u "$username"):$(id -g "$username")" "$homedir"
        fi
      done

      # chroot users to /home, not /home/<user>
      sed -E -i 's|^(ChrootDirectory\s+).*|\1/home|' '/etc/ssh/sshd_config'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant