Disable Usersetup
Overview
When an SFTP user logs into SFTP Gateway, a script is run to make sure the chroot directory is configured properly, and to scan that directory for subfolders and stuck files.
Some SFTP clients may open multiple sessions. This initiates multiple scans that can overwhelm the server.
The current workaround is to disable the login script so that it no longer initiates a scan.
Disable usersetup on login
SSH into the VM and elevate your privileges:
sudo su
Edit the file:
/usr/local/bin/pamwrapper.sh
Replace the contents of the file with the following code:
#!/bin/sh
user=${PAM_USER}
#if [[ "$PAM_TYPE" == "close_session" ]]; then
# # TODO: hook this up in pam
# (/usr/local/bin/ts-folderscan -n bash -c '${0} ${1+"$@"}' /usr/local/bin/userfolderscan "$user") &
# exit 0
#elif [[ "$PAM_TYPE" == "open_session" ]]; then
# /usr/local/bin/usersetup "$user"
#fi
Here, you are commenting out the last 7 lines (by prepending the #
character).
This has the effect of skipping the usersetup
command on login.