I have this Linux script I found and I'm trying to understand it. Could someone please help me to understand it.
The script
if [ ! -d "/home/ftp/$PAM_USER" ]; then
/bin/su - ftp -s /bin/sh -c "/usr/bin/env mkdir /home/ftp/$PAM_USER"
/bin/su - ftp -s /bin/sh -c "/usr/bin/env chmod 751 /home/ftp/$PAM_USER"
fi
Things I don't understand
if [ ! -d "/home/vsftpd/$PAM_USER" ]; then
I'm assuming the script above is a condition check to see if the pam user directory exist
what does the /bin/su
mean
what does the ftp
mean
What does -s /bin/sh
mean
What does the -c /usr/bin/env
mean
/bin/su - ftp -s /bin/sh -c "/usr/bin/env chmod 751 /home/vsftpd/$PAM_USER"
fi
Lastly how can I test to be sure this script is even working?
I apologize if the answer seems basic or incomplete. Unfortunately do to my current knowledge level, I'm not sure what questions to be asking.