【问题标题】:automount w/ sshfs on macOS catalina在 macOS catalina 上使用 sshfs 自动挂载
【发布时间】:2020-04-03 22:34:36
【问题描述】:

我正在尝试在 macOS Catalina 上使用 automountsshfs 设置 SSH 端点的自动挂载。但是,它不起作用,我不知道为什么。

  1. /etc/auto_master
+auto_master        # Use directory service
#/net           -hosts      -nobrowse,hidefromfinder,nosuid
/home           auto_home   -nobrowse,hidefromfinder
/Network/Servers    -fstab
/-          -static
# custom; auto-mount wolverine (parker lab setup)
/-  auto_wolverine  -nosuid
  1. /etc/auto_wolverine
/System/Volumes/Data/wolverine/home -fstype=sshfs,reconnect,nodev,follow_symlinks,allow_other,StrictHostKeyChecking=no,IdentityFile=IDFILE,port=PORT,ServerAliveInterval=360,ServerAliveCountMax=3 USER@HOST:/home
  1. /etc/sythetic.conf

wolverine /System/Volumes/Data/wolverine

根据我看到的教程之一,我还将sshfs 二进制文件符号链接到/usr/local/bin/mount_sshfs。 但是,当我尝试打开目标目录时(刷新挂载后),它显示No such file or directory。任何帮助将不胜感激。

【问题讨论】:

标签: macos macos-catalina sshfs automount


【解决方案1】:

这里的问题是automount 试图在/sbin 中搜索mount_sshfs。因此,尽管您已创建该符号链接,但它不适用于 automount

由于 macOS Catalina,/sbin 被挂载为 只读 卷,因此您将无法创建所需的符号链接:/sbin/mount_sshfs -> /usr/local/bin/sshfs。你可以在Apple's support webpage找到更多信息。

在 macOS 10.15 Catalina 的早期版本中对我有用的一件事是禁用 System Integrity Protection 并从 Recovery OS 分区创建所需的符号链接。但我不知道这张剧照是否适用于 Catalina。

您可以在此document 中找到如何禁用 SIP。

如果您最终设法创建了符号链接,您可能需要添加以下守护程序来启用内核扩展以进行自动挂载:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <false/>
    <key>Label</key>
    <string>sysctl</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/bash</string>
        <string>-c</string>
        <string>/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse; /usr/sbin/sysctl -w vfs.generic.osxfuse.tunables.allow_other=1</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

将其命名为load.osxfusefs.tunables.plist 并将其放入/Library/LaunchDaemon

您可以在来自 Apple StackExchange 的 this answer 中找到解释得很好的指南。

【讨论】:

  • 感谢您的回答。我应该提到我确实在禁用 SIP 后将mount_sshfs 放入了/sbin,但这也无济于事。也许,这是我缺少的 launchDaemon 组件..会让你知道它是怎么回事。
  • 确实,看起来唯一剩下的就是添加内核扩展了。那成功了。谢谢!现在开始与 osxfuse 错误作斗争..
最近更新 更多