diff --git a/add-sftp.sh b/add-sftp.sh index 4bb6be0..0c0c895 100644 --- a/add-sftp.sh +++ b/add-sftp.sh @@ -20,8 +20,12 @@ if [ $? -ne 0 ]; then fi echo "$USERNAME:$PASSWORD" | chpasswd -# Set user's group to litespeed (or another group with SFTP permissions) -usermod -aG litespeed $USERNAME +# Set user's group to both litespeed and root +usermod -aG litespeed,root $USERNAME + +# Adjust permissions for the user to write to the ROOT_DIRECTORY +chown $USERNAME:root $ROOT_DIRECTORY +chmod 775 $ROOT_DIRECTORY # Get the hostname HOSTNAME=$(hostname -f) diff --git a/install-sftp.sh b/install-sftp.sh new file mode 100644 index 0000000..25b1c73 --- /dev/null +++ b/install-sftp.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Become root +sudo su + +# Download the SFTP user creation script +curl -O https://deploy-proxy.mightybox.io/addons/add-sftp-user/raw/branch/main/add-sftp.sh +chmod +x add-sftp.sh + +# Update sshd_config +echo -e "\nMatch User user*\nPasswordAuthentication yes" >> /etc/ssh/sshd_config + +# Adjust permissions +chown root:root /var/www/webroot/ROOT +chmod 755 /var/www/webroot/ROOT