Stop SSHFS hanging, and name the real reason Gatekeeper refuses an app

With macFUSE's FSKit extension off, sshfs waits forever and ignores TERM;
sftp_mount gives it 30 seconds, then stops it and says to turn macFUSE on.

On a Mac that allows only App Store apps, app_install said the download
"isn't notarized"; it now says the Mac only allows App Store apps, and where
to change that.

The vanilla image is like that and since macOS 15 only System Settings or
MDM can change it, so 70-apps checks the message and skips the installs
there. 85-sftp checks that add_sftp gives up while the extension is off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-11 15:01:03 -07:00
co-authored by Claude Opus 5.5
parent f2e6908dfd
commit eab26c0888
5 changed files with 74 additions and 11 deletions
+18 -2
View File
@@ -92,7 +92,7 @@ sftp_mounted() {
# mounted. reconnect and ServerAlive* bring it back after the network drops
# (e.g. sleep); idmap=user shows your files on the server as yours here.
sftp_mount() {
local url="$1" point="$2" backend opts
local url="$1" point="$2" backend opts pid i
backend="$(fuse_backend)" || return 1
sftp_parse "$url"
use_ssh_agent
@@ -104,7 +104,23 @@ sftp_mount() {
mkdir -p "$point" || return 1
opts="$opts,defer_permissions,noappledouble"
fi
"$SSHFS" "$SFTP_USER@$SFTP_HOST:$SFTP_PATH" "$point" -o "$opts"
# With macFUSE's extension off, SSHFS waits forever (and ignores TERM), so
# it gets 30 seconds
"$SSHFS" "$SFTP_USER@$SFTP_HOST:$SFTP_PATH" "$point" -o "$opts" &
pid=$!
for i in $(seq 1 30); do
kill -0 "$pid" 2> /dev/null || { wait "$pid"; return; }
sleep 1
done
kill -TERM "$pid" 2> /dev/null
sleep 2
kill -KILL "$pid" 2> /dev/null
wait "$pid" 2> /dev/null
if [ "$backend" = fskit ]; then
echo "SSHFS didn't finish mounting. Is macFUSE turned on in System Settings, under"
echo "General > Login Items & Extensions > File System Extensions?"
fi
return 1
}
sftp_unmount() {