separated the install requirements

main
Anthony 2023-10-28 00:19:22 +08:00
parent 3c9318b57f
commit 703c7a3943
2 changed files with 21 additions and 2 deletions

View File

@ -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)

15
install-sftp.sh 100644
View File

@ -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