oh-my-zsh 每次打开出现 zsh compinit: insecure files, run compaudit for list. Ignore insecure files and continue [y] or abort compinit [n]? 问题(Oh-my-zsh each time you open it, Zsh verify: Secure files, run audit for list. Ignore secure files and continue [y] or abort verify [n]? problem)

具体问题描述如下, 没什么屁用

Last login: Wed Nov 24 16:45:07 on ttys007
[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x  1 root  staff  39  9 12 21:07 /usr/local/share/zsh/site-functions/_brew -> ../../../Homebrew/completions/zsh/_brew
lrwxr-xr-x  1 root  staff  88 10  1 11:18 /usr/local/share/zsh/site-functions/_brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services

[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 files, run compaudit for list.
Ignore insecure files and continue [y] or abort compinit [n]? 

uploading-image-772656.png

博客园服务器在干啥, 又上传不了图片

在网上搜了办法, 如 https://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories,

一般就两步

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

$ sudo chown -R root:root /usr/local/share/zsh/site-functions

但他们只能解决简单的 和 这两个目录的安全性问题,

zsh
zsh/site-functions

解决不了

_brew
_brew_services
(用 命令查看的不安全目录)

compaudit

这两个目录的的安全问题

最后在这上面找到了解决办法, 这位老哥的这两个目录同样遇到了这个问题

https://www.cnblogs.com/r1char/p/13095123.html

执行

sudo chown root /usr/local/share/zsh/site-functions/_brew

_brew_services 同理执行, 完事就好了, 这俩命令有啥不一样可以择时再学习;博客园

————————

The specific problems are described as follows. It’s useless

Last login: Wed Nov 24 16:45:07 on ttys007
[oh-my-zsh] Insecure completion-dependent directories detected:
lrwxr-xr-x  1 root  staff  39  9 12 21:07 /usr/local/share/zsh/site-functions/_brew -> ../../../Homebrew/completions/zsh/_brew
lrwxr-xr-x  1 root  staff  88 10  1 11:18 /usr/local/share/zsh/site-functions/_brew_services -> ../../../Homebrew/Library/Taps/homebrew/homebrew-services/completions/zsh/_brew_services

[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 files, run compaudit for list.
Ignore insecure files and continue [y] or abort compinit [n]? 

uploading-image-772656.png

What is the blog Park server doing and can’t upload pictures

在网上搜了办法, 如 https://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories,

Usually two steps

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

$ sudo chown -R root:root /usr/local/share/zsh/site-functions

But they can only solve the simple and security problems of these two directories,

zsh
zsh/site-functions

unable to solve

_ brew
_ brew_ services
(unsafe directory viewed with command)

compaudit

Security issues of these two directories

Finally, a solution was found. The two directories of the old man also encountered this problem

https://www.cnblogs.com/r1char/p/13095123.html

implement

sudo chown root /usr/local/share/zsh/site-functions/_brew

_ brew_ The same applies to services. It’s good to finish. You can learn when the two commands are different; Blog Garden