Nov 252009

UPDATE: 1/4/10
After restoring a site in WHM, a client stated his IP addresses in WHM Main >> Account Information >> List Accounts page. In checking, all that was seen was the work ‘Unknown’ in the IP section of the page. This is the 3rd time I have come across this error and have documented the repair walk-through here.

cat /etc/passwd | sed -e 's/:x:[0-9]\{3\}/\:x/' -e 's/::.*/:/' > /root/pwd_to_grp
mv /root/pwd_to_grp group
cat /etc/passwd | sed -e 's/:x:[0-9]\+/\:x/' -e 's/::.*/:/' > /root/group
diff group group.bak
for each in `cat group | sed -e '/[a-Z]$/!d'`; do username=${each%%:*}; sed -e "s/^$username:.*/$each/" group.bak ;done
diff group /etc/group
diff group /etc/group |grep username
diff group /etc/passwd |grep username
ls /etc/ |grep passwd
ls /etc/ |grep group
echo -n > /etc/group
cp group /etc/group
diff group /etc/passwd |grep username
/scripts/ensure_vhost_includes --all-users
/etc/init.d/httpd restart

 Posted by at 7:18 am