ClawHub
SkillsPluginsOfficialDocsSupport
K
Skillsmac-remote

mac-remote

Jeff Yang@j3ffyang
Inspect or administer a macOS machine over SSH, on the LAN or through a reverse tunnel. Every command requires explicit approval before execution, including read-only checks. Use for health reports, app launches, VSCodium workspace setup, SSH UI automation, screenshot permissions, app removal, and tunnel diagnosis.
Install in OpenClawRequires OpenClaw desktop app
Security check
Review
Version
1.0.0
Updated
Nov 30, 2026
License
MIT-0

Latest: v1.0.0

mac-remote 1.0.0 establishes approval-first remote management for macOS over SSH.

  • Requires explicit approval for every command, including read-only checks, verification, retries, and rollback.
  • Documents LAN and reverse-tunnel SSH routes, with aliases kept in ~/.ssh/config.
  • Adds fast and full health-report procedures, including system status and optional logs, updates, and hardware details.
  • Provides guidance for app launches and removal, plus reverse-tunnel setup and diagnosis.
Other

Remote management of a macOS machine

Inspect or administer a macOS host over SSH without installing an agent on it. Every command requires explicit approval before execution. Prefer read-only inspection before proposing changes.

Approval gate

  1. Show the exact command or complete command batch.
  2. Identify the target and explain the purpose.
  3. For state-changing commands, describe the effects and rollback method.
  4. Wait for the user's explicit approval of those commands.
  5. Execute only the approved commands.
  6. If another command is needed, request approval before execution.

This gate covers read-only checks, scripts, application launches, configuration changes, verification, retries, and rollback commands. It also covers local and relay commands used for Mac management. For scripts, show their contents or identify the reviewed script and its exact arguments. Approval covers only the displayed commands and the stated execution. A general task request is not approval for undisclosed commands. Tool permissions do not replace user approval.

About this skill

  • Two paths, one host. A LAN alias and a -away alias that rides a reverse tunnel through a relay. Both land on the same machine and verify against the same pinned host key.
  • Prefer the LAN path. Measured for the same report: about 1 s on the LAN, about 7 s through the tunnel.
  • One round trip, not twenty. Every probe runs inside a single remote bash -s. LAN links jitter by tens of milliseconds and the tunnel crosses two oceans twice, so a probe-per-connection design is unusable.
  • No sudo. The skill has no business escalating, and every probe below runs unprivileged.
  • Approval is required for every command. The host belongs to whoever sits at it.

Resolving the target

For desktop automation and VSCodium setup, read Desktop setup. Apply the approval gate to every command in that reference.

Aliases live in ~/.ssh/config, and they are the only place the address is recorded. Never guess a hostname or an address.

bash
ssh -G <alias> | grep -E '^(host|hostname|port|proxyjump) '   # what an alias really resolves to

Set MAC_HOST (or pass the host as the first argument) so the scripts stay address-free:

bash
export MAC_HOST=<alias>

A machine reached two ways usually has two aliases:

AliasRouteWhen
<target>direct, LAN addresssame network
<target>-awayProxyJump <relay> → <relay>:127.0.0.1:<port> → mac:22any other network

Never hardcode the address in a script or a skill. A DHCP lease moves; ~/.ssh/config is where that is maintained.

Procedure — the health report

bash
scripts/mac_health.sh                      # uses $MAC_HOST
scripts/mac_health.sh <alias>              # explicit host
scripts/mac_health.sh --full <alias>       # + log scan, updates, hardware profile

It reports: identity and OS, uptime, load and swap, disk, top CPU and memory consumers, battery and sleep policy, FileVault / SIP / Gatekeeper / firewall, Time Machine state, and addressing. With --full it adds recent errors, pending updates, and a hardware profile with the serial number and UUID masked.

The fast tier is the default on purpose. log show and softwareupdate -l each cost seconds, and the update check reaches the network.

Read-only command examples

Present the selected commands as a batch for approval before execution:

bash
ssh <alias> 'df -h /; sysctl -n vm.swapusage; tmutil latestbackup'
ssh <alias> 'ps -Ao rss=,pid=,comm= -m | head -5'
ssh <alias> 'log show --last 10m --predicate "process == \"kernel\"" --style compact | tail -20'

Stop and ask

All commands require approval. For these actions, explain the consequences before requesting approval:

ActionWhy it is not automatic
sudo anythingneeds a password the user holds, and is outside this contract
kill or restart a process or appcan lose unsaved work
write, move, or delete a filethe machine is not yours
softwareupdate -i, package installschanges system state
pmset or machine-wide launchctl changesaffects power and boot behaviour
reboot or shutdownends the tunnel and any remote session

If a probe needs root, say so and stop. Do not reach for sudo.

Verify app launches

  1. Request approval for the launch command.
  2. After launch, request approval for process and listener checks.
  3. Confirm the expected process exists.
  4. For a proxy, confirm the configured port has a listener.
  5. Ask the user to confirm the visible result.

A successful open -a only confirms that the launch request returned successfully. It does not prove the app stayed running. A listener does not prove upstream connectivity.

Remove apps and old agents

  1. Request approval to inspect the exact app path and matching processes.
  2. For an agent, inspect its plist and launchd status after approval.
  3. Distinguish a loaded agent from a running process.
  4. Show the exact removal commands and recovery method.
  5. After approval, unload an obsolete agent before moving its files to Trash.
  6. Move only the approved paths.
  7. Request separate approval before emptying all Trash contents.

A launchctl list row with - in the PID column describes a loaded job without a running process. RunAtLoad = false does not mean the job is unloaded. Check both configuration and runtime state.

Moving an app to Trash does not remove its preferences or support data. Emptying Trash permanently removes other trashed items too. Recover trashed files before emptying Trash if rollback is needed.

How the tunnel works

The target dials out; the relay never dials in. A consumer router drops inbound connections, IPv6 included, so the reverse direction is the only one available:

text
<target>-away ──ssh──> <relay>:22
                       └─ proxy to 127.0.0.1:<port>
                                 ▲
                                 │ reverse forward held by the target
   mac ──outbound ssh -N -R 127.0.0.1:<port>:localhost:22────────────────┘
  • The listener binds 127.0.0.1 only on the relay. Nothing is exposed to the internet.
  • A system LaunchDaemon can run at the macOS login window after boot. It cannot run at the FileVault pre-boot unlock screen.
  • The agent type decides when the tunnel exists. A launchd user agent (macOS) or a systemd user unit (Linux) runs only while that user is logged in. A system LaunchDaemon with UserName set starts at boot and survives the login window, at the cost of needing root to install — and root to stop. Pick one per machine: running both makes them fight over the listen port, and the loser retries on a timer.
  • Verify it: ssh <relay> 'ss -ltn "sport = :<port>"'. A missing listener means the machine slept, rebooted to a disk-unlock screen, or lost its network.

Health of the tunnel itself

SymptomCheckMeaning
-away alias times out after ProxyJumpssh <relay> 'ss -ltn "sport = :<port>"'no listener → the target-side agent is down
Connection closed by UNKNOWNsamethe tunnel died mid-handshake, or the machine slept
Host key verification failedread the preceding SSH diagnosticgeneric summary, not proof of a changed key
No ... host key is knowninspect the effective HostKeyAlias and client trust entrymissing trusted key for that name and key type
REMOTE HOST IDENTIFICATION HAS CHANGEDcompare the presented key with an independently verified fingerprintkey mismatch — stop and ask. Never delete the entry to bypass verification
LAN alias fails but -away workscompare ssh -G <target>, the target's current address, and the SSH diagnosticpossible address, routing, network isolation, or trust problem. A lease change is not established

Verify a missing or changed host key

  1. Read the complete SSH diagnostic.
  2. Inspect the effective host-key name and trust-file settings on the client:
bash
ssh -G <alias> | grep -E '^(hostname|port|proxyjump|hostkeyalias|stricthostkeychecking|userknownhostsfile) '
  1. Ask the owner to obtain the host-key fingerprint locally on the Mac:
bash
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
  1. Inspect the matching trust entry on the client:
bash
ssh-keygen -F <host-key-name> -f <known-hosts-file> | ssh-keygen -lf -

Use the effective HostKeyAlias when configured. For other key types, use the corresponding public host-key file.

  1. If no trusted entry exists, compare the candidate fingerprint with the owner's independently supplied fingerprint.
  2. Get approval before adding a matching key to the client's trust file.
  3. If an existing key differs, stop for investigation.
  4. After trust is established, retry with StrictHostKeyChecking=yes.

A fingerprint collected only through the unverified connection is not independent evidence. A network move alone does not establish an address change.

After approval of the exact command, restart the target side:

bash
ssh <target> 'launchctl kickstart -k gui/$(id -u)/<label>'      # macOS
ssh <target> 'systemctl --user restart <unit>'                  # Linux

Security model — what a compromised target gets

The tunnel key is only harmless because the relay's authorized_keys line is restricted. Verified by test:

text
restrict,port-forwarding,permitlisten="127.0.0.1:<port>",permitopen="127.0.0.1:1",command="/bin/false"
An attacker holding the key getsResult
a shell, pty, or any command as the relay userno — command="/bin/false" replaces every session command
-L or -D into the relay's private networkno — permitopen points at a dead port, server answers administratively prohibited
other listening ports on the relayno — permitlisten allows one address and port
the one allowed listener, forwarded anywhereyes — so the -away alias must keep StrictHostKeyChecking=yes
connection attempts at the relayyes — log noise, not access

Two traps, both measured:

  • restrict alone does not prevent command execution. It disables forwarding, pty, agent and X11, but a plain ssh -T key@host 'cmd' still runs. command= is what closes it.
  • restrict,permitlisten=… alone refuses -R ("remote port forwarding failed"). port-forwarding must re-enable it, which re-enables -L as well, which makes permitopen mandatory rather than optional.

A tunnel key avoids the bigger problem: no model keys, no repository tokens, no control channel on the target. The only secret added is worth one loopback port on one host.

Pinning one host key to two paths

Reaching one machine two ways would normally mean two known_hosts entries, and a DHCP lease guarantees one of them rots. HostKeyAlias collapses them onto a single entry:

text
Host <target>
    HostName <lan-address>
    HostKeyAlias <target>
    User <user>

Host <target>-away
    HostName 127.0.0.1
    Port <port>
    ProxyJump <relay>
    HostKeyAlias <target>
    StrictHostKeyChecking=yes

Cross-check the relay's host key from both machines before pinning, instead of trusting first contact:

bash
ssh-keygen -F <relay> -f ~/.ssh/known_hosts | ssh-keygen -lf -

Blind spots

  • Health reports sample state. They do not continuously detect drift.
  • Sleep is invisible. A suspended machine looks identical to a broken tunnel.
  • log show is not a security audit. Retention and predicates vary by macOS version.
  • fdesetup status reports policy, not reality. Encrypted-volume state on a locked disk needs root.
  • Latency is not a fault. Tens of milliseconds of jitter to a LAN peer is often Wi-Fi power save, not a broken link.

Rollback

Tunnel removal affects remote access. Present the applicable rollback commands for approval before execution:

bash
# target: stop and remove the tunnel agent
launchctl bootout gui/$(id -u)/<label> && rm ~/Library/LaunchAgents/<label>.plist

# relay: drop the restricted key
grep -v '<tunnel-key-id>' ~/.ssh/authorized_keys > /tmp/ak
install -m 600 /tmp/ak ~/.ssh/authorized_keys

# workstation: delete the two Host blocks, and the pinned key entry

Keep a timestamped copy of authorized_keys before the first edit. It is the one file where a careless rewrite locks you out of your own server.

ClawHub

Skills and plugins for OpenClaw agents. Part of the wider OpenClaw ecosystem.

Explore docs

SkillsPluginsOfficialAudits

Publish SkillPublish PluginCreate org

OverviewOpenClawDocsBlog

SupportGitHubDiscord

Built alongside the OpenClaw ecosystem

LobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projectsLobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projects

© 2026 OpenClaw Foundation

Privacy policy·Status·Deployed on Vercel·Powered by Convex

....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals