Skip to content

Instantly share code, notes, and snippets.

@inetbiz
Last active September 12, 2017 06:05
Show Gist options
  • Save inetbiz/bf77315014cb8a407f39 to your computer and use it in GitHub Desktop.
Save inetbiz/bf77315014cb8a407f39 to your computer and use it in GitHub Desktop.
cPanel user nobody chown to cp user
#!/bin/bash
# Script to fix permissions of cpanel nobody file and folders
# Written by: Denver Prophit Jr. 03/13/2015
# https://www.strikehawk.com
for user in `ls -A /var/cpanel/users`
do
HOMEDIR=$(egrep "^${user}:" /etc/passwd | cut -d: -f6)
find $HOMEDIR ! -user $USER -exec chown $USER {} \;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment