Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- GROUP="ftp"
- FOLDERNAME=$1
- USERNAME=$2
- PASSWORD=$3
- # Add new user
- /usr/sbin/useradd -n $USERNAME -g $GROUP
- # Create directory and subdirectory
- /bin/mkdir -p /ftpchroot/$FOLDERNAME/upload
- cd /ftpchroot/$FOLDERNAME
- # Change Owner/Group
- chown $USERNAME:$GROUP upload/
- # Setting tomcat ACL
- /usr/bin/setfacl -Rm u:tomcat:rwx upload/ && setfacl -Rdm u:tomcat:rwx upload/
- # Setting password
- echo -e $USERNAME:$PASSWORD | chpasswd
- /usr/sbin/edquota -p user01 $USERNAME
- GOTERROR=$?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement