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

269ac00f765508cb74b25d006dbf5bb2

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