修改了oh-my-zsh权限,做了某些操作,后续打开终端提示各种不安全操作

运行终端冒出一大推的信息,如下:

[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxrwx   20 xxxxx  staff   640 12 16 09:03 /Users/xxxxx/.oh-my-zsh
drwxrwxrwx    4 xxxxx  staff   128 12 16 09:01 /Users/xxxxx/.oh-my-zsh/custom/plugins
drwxrwxrwx   26 xxxxx  staff   832 12 16 09:01 /Users/xxxxx/.oh-my-zsh/custom/plugins/zsh-autosuggestions
drwxrwxrwx  275 xxxxx  staff  8800 12 16 09:04 /Users/xxxxx/.oh-my-zsh/plugins
drwxrwxrwx    4 xxxxx  staff   128 12 16 08:52 /Users/xxxxx/.oh-my-zsh/plugins/git
drwxrwxrwx    3 xxxxx  admin    96 11 18 13:22 /usr/local/share/zsh

[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.

解决问题:

我们可以看到下面的提示信息,都是可以帮助我们去解决的。
有两种:

第一种:我们按照所有的提示去修改我们的权限即可。

chmod 755 /Users/xxxxx/.oh-my-zsh
chmod 755 /Users/xxxxx/.oh-my-zsh/custom/plugins
chmod 755 /Users/xxxxx/.oh-my-zsh/custom/plugins/zsh-autosuggestions
chmod 755 /Users/xxxxx/.oh-my-zsh/plugins
chmod 755 /Users/xxxxx/.oh-my-zsh/plugins/git
chmod 755 /usr/local/share/zsh

第二种:

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

让我们在 ~/.zshrc 这个文件中新增 ZSH_DISABLE_COMPFIX 为true即可。

你可能感兴趣的:(修改了oh-my-zsh权限,做了某些操作,后续打开终端提示各种不安全操作)