search
HomeCommon ProblemFix the 'unsafe completion-related directory detected' issue in Oh My Zsh

Option 1: Change the permissions of the specified directory

One option to change the permissions is to use chmod 755, which is full permissions for the owner (you) and provides to others Read and execute permissions for the relevant directory. For example:

chmod 755 /usr/local/share/zsh

##chmod 755 /usr/local/share/zsh/site-functions

You can of course use other permission options that suit you better, but 755 should solve Oh My Zsh's insecure directory problem.

(BTW, for most setups, the default permissions for these directories are 775 for rwxrwxr-x, if you want to revert to that for any reason).

Option 2: Disable Insecure Directory Checks

If you don't want to change permissions and just disable the insecure directory verification (this basically just ignores the check, it doesn't solve the underlying security issue), You can add the following to your .zshrc file:

ZSH_DISABLE_COMPFIX=true

Using nano is one way to add this to your .zshrc file or The easy way with your text editor of choice.

修复 Oh My Zsh “检测到不安全的完成相关目录”

Again, this does not resolve the permissions complaint, it just stops checking permissions for the specified directory.

For many users, it is desirable to make /usr/local/share/zsh/ accessible to all user accounts so that all user accounts on the Mac can use Oh My Zsh, but for others who would like For people who want a more restrictive environment on shared user computers, you can also change the permissions to accommodate this. The choice is yours.

The complete error message states the following, mainly telling you how to solve the problem, but not necessarily written in the most concise way to get an immediate solution. Still, it's worth reading and reviewing so you can see what options Oh My Zsh spells out and the consequences of each option for eliminating secure messages.

[oh-my-zsh] Insecure completion dependency directory detected:

drwxrwxr-x 3 user admin 96 Jun 29 2020 /usr/local/share/zsh
drwxrwxr -x 5 user admin 160 Jul 19 14:54 /usr/local/share /zsh/sitefunction

[oh-my-zsh] For security reasons, we will not load from these directories until

[oh-my-zsh] You fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the list above for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do this by disabling

[oh-my-zsh] write permissions for "group" and "others" and ensuring that
The [oh-my-zsh] owner directory is root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod gw,ow

[oh-my-zsh] If the above Doesn't help or you want to skip validation for

[oh-my-zsh] unsafe directories, you can
set the variable ZSH_DISABLE_COMPFIX to [oh-my-zsh] "true" before oh -my- zsh from your zshrc file.

The above is the detailed content of Fix the 'unsafe completion-related directory detected' issue in Oh My Zsh. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:云东方. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.