Fix missing symlinks from home to alternative home directories in cPanel servers

Get a list of accounts in the ‘secondary’ home directory (in this example, home3)…

[[email protected] home]# cat /etc/passwd|grep home3|awk -F: ‘{print $1}’ > /root/home3list

Find all symlinks missing from /home…

[[email protected] home]# for user in `cat /root/home3list`; do if [ ! -L /home/$user ]; then echo $user >> /root/missing; fi; done

Add the missing symlinks…

[[email protected] home]# for user in `cat /root/missing`; do ln -s /home3/$user /home/$user; done
Was this article helpful?
Thank you!