Lad Who Codes

How to fix Insecure completion-dependent directories - ZSH

Posted by Dinesh Verma on Tuesday 26 February 2019

ZSH is basically a shell for Linux/Unix-like operating systems. ZSH provides many advanced features and powerful command line editing options, such as enhanced Tab completion, support for plugin, themes and aliases and much more.

Setting up ZSH on your system is not difficult at all, all you have to do is follow the guide here. Things can get complicated if you have multiple accounts on your system and ZSH installed in all of them. This is where you start getting the Insecure completion-dependent directories error.

What does the error Insecure completion-dependent directories means

In precise terms this error means that there are files and folders the underlying system is trying to access and they neither belong to current logged in user nor the root. Hence, for security reasons, the system cannot load the files and you are fu*_*ed.

Now, lets look into how can we fix this issue.


$ cd /usr/local/share/zsh
$ sudo chmod -R 755 ./site-functions

ALSO RUN THE FOLLOWING COMMANDS

$ cd /usr/local/share/
$ sudo chmod -R 755 zsh
$ sudo chown -R root:staff zsh

The above mentioned commands should fix it for you, but in my case I was still getting error. To fix them, I created a group in MAC and added both my accounts to it. Then, changed the owner of the insecure files/folders to the Group using the below mentioned command. Then restart terminal.


sudo chown -R <your-username>:<your-group-name> <FOLDERS HERE>

I think these should fix the problem for you, but if you still face the issue do comment here with the complete logs.

Post a Comment