Article Directory
Install ssh
1. The computer turns on remote sharing
System Preferences-Sharing
2. Generate secret key
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3. Verification
ssh localhost
HomeBrow
1. Installation
foreign:
Official website: https://brew.sh/index_zh-cn
Download: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Domestic mirror (recommended):
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
1. Select Chinese Academy of Sciences
2. Enter password
2. Mirror acceleration
Use the domestic mirror to replace the homebrew mirror, and accelerate the source of the mirror
When the brew command is executed to install, it is related to 3 warehouse addresses
-
brew.git
-
homebrew-core.git
-
homebrew-bottles
Step 1: Replace all three warehouse addresses with addresses provided by Alibaba in China
brew.git 仓库地址:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
homebrew-core.git仓库地址
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
Step 2: Replace homebrew-bottles, first check the shell version, execute echo $SHELL
- zsh terminal operation mode
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
- Bash terminal operation mode
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
above sea level
brew install node
Turn off Rootless
Rootless Apple has used the Rootless mechanism since OS X El Capitan 10.11. The system will lock the three directories /system, /sbin, and /usr by default. To get the write permission of these three directories, the user needs to turn off Rootless
- Restart the Mac and press Command+R after booting to enter the recovery mode.
- Find and open Terminal in the above menu utility
- Enter the following command: csrutil disable
- Restart the MAC and authorize /system, /sbin, /usr
- sudo chown -R $(whoami) /usr/local
Home directory permission modification
-
Compile the /etc/auto_master file
Comment out or remove the line starting with /home
nano /etc/auto_master
-
Make the configuration effective
cd / # 进入到根目录 sudo automount -vc
-
verification
cd /home # 进入到home目录 sudo mkdir 你的目录 # 创建work目录 chmod 777 -R 你的目录 # 修改读写权限 chown work:work 你的目录 ·# 修改所属组为work