Advertisement
Guest User

Untitled

a guest
Jun 9th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/bash
  2. GROUP="ftp"
  3. FOLDERNAME=$1
  4. USERNAME=$2
  5. PASSWORD=$3
  6. # Add new user
  7. /usr/sbin/useradd -n $USERNAME -g $GROUP
  8. # Create directory and subdirectory
  9. /bin/mkdir -p /ftpchroot/$FOLDERNAME/upload
  10. cd /ftpchroot/$FOLDERNAME
  11. # Change Owner/Group
  12. chown $USERNAME:$GROUP upload/
  13. # Setting tomcat ACL
  14. /usr/bin/setfacl -Rm u:tomcat:rwx upload/ && setfacl -Rdm u:tomcat:rwx upload/
  15.  
  16. # Setting password
  17. echo -e $USERNAME:$PASSWORD | chpasswd
  18.  
  19. /usr/sbin/edquota -p user01 $USERNAME
  20.  
  21. GOTERROR=$?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement