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


Written by Dennis Nind

Last published at: February 8th, 2019

Get a list of accounts in the 'secondary' home directory (in this example, home3)... 

[root@bravo home]# cat /etc/passwd|grep home3|awk -F: '{print $1}' > /root/home3list 

Find all symlinks missing from /home... 

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

Add the missing symlinks... 

[root@bravo home]# for user in `cat /root/missing `; do ln -s /home3/$user /home/$user; done