更新mac 系统 oh-my-zsh 权限问题

更新完系统,更新 oh-my-zsh, 每次都要弹的信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxrwx 3 huosj admin 96 Jan 19 14:55 /usr/local/share/zsh
drwxrwxrwx 5 huosj admin 160 Jan 19 17:34 /usr/local/share/zsh/site-functions

[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w

[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

翻译这句话: For safety, we will not load completions from these directories until you fix their permissions and ownership and restart zsh.
“为了安全起见,我们将不会从这些目录加载完成,直到您修复了它们的权限和所有权并重新启动zsh“

而上面说的权限目录在:

1
2
/usr/local/share/zsh  
/usr/local/share/zsh/site-functions

所以,我们要做的就是 给这两个目录权限,如下:

1
2
chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functions
原创技术分享,您的支持将鼓励我继续创作