为了方便使用oss当同步盘 采用ossfs方式进行挂载bucket 又因为阿里没有mac的ossfs 顾尝试编译源码
安装OSXFUSE
brew install macfuse
克隆源码
git clone https://github.com/aliyun/ossfs.git
安装openssl
brew install openssl
配置环境
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
执行autogen.sh
./autogen.sh
执行./configure
./configure
MAKE & MAKE INSTALL
make
sudo make install
配置OSSFS
sudo touch /etc/passwd-ossfs
# 把自己的配置写进去
# my-bucket:my-access-key-id:my-access-key-secret
# 设置权限
chmod 640 /etc/passwd-ossfs
# 创建要挂载的路径
mkdir /tmp/oss-bucket
# 开始挂载
ossfs my-bucket /tmp/oss-bucket -ourl=http://oss-cn-hangzhou.aliyuncs.com -oallow_other
成功展示