解決oh my zsh Insecure completion-dependent directories detected

安裝oh my zsh 的命令

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"


--2020-04-10 15:44:32--  https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
正在解析主機 raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.108.133
正在連接 raw.githubusercontent.com (raw.githubusercontent.com)|151.101.108.133|:443... 已連接。
已發出 HTTP 請求,正在等待迴應... 200 OK
長度:8445 (8.2K) [text/plain]
正在保存至: “STDOUT”

100%[=================================================================>]   8.25K  --.-KB/s  用時 0s      

2020-04-10 15:45:09 (21.1 MB/s) - 已寫入至標準輸出 [8445/8445]

Cloning Oh My Zsh...
Cloning into '/Users/zhl/.oh-my-zsh'...
remote: Enumerating objects: 1140, done.
remote: Counting objects: 100% (1140/1140), done.
remote: Compressing objects: 100% (1103/1103), done.
remote: Total 1140 (delta 19), reused 1127 (delta 19), pack-reused 0
Receiving objects: 100% (1140/1140), 753.95 KiB | 17.00 KiB/s, done.
Resolving deltas: 100% (19/19), done.

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!


Please look over the ~/.zshrc file to select plugins, themes, and options.

p.s. Follow us on https://twitter.com/ohmyzsh

p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh

成功之後,打開新的終端後,會顯示一些信息(以前安裝的時候,沒有這玩意):

[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x  3 zhangli53  admin  96  4  8 12:12 /usr/local/share/zsh
drwxrwxr-x  2 zhangli53  admin  64  4  8 12:12 /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.

所以要把這個信息屏蔽掉:

vim ~/.zshrc

文件第一行加入:

ZSH_DISABLE_COMPFIX="true"    # 有引號

保存之後,再執行命令:

source ~/.zshrc   # 原封不動的執行這條命令就ok了,再開新終端就生效了
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章