macOS Preperation – Enable Remote Login on target Mac
- Open System Preferences

- Find Sharing (or search for “remote”)

- Turn on Remote Login. Enable “All Users” or add just one.

- Note the machine name (dougbeal-mb1.local), you will need it for the shortcut. You can also edit the name here.
Create ssh shortcut on iOS
- Launch Shortcuts application.
- Create a new shortcut.

- Add Action to shortcut.

- Search for
sshand selectRun Script Over SSH.
- Tap
Show More.
- In the
Authenticationsection, selectSSH Key. Shortcuts will automatically generate a key for you.
- Tap
Scriptand swipe above keyboard and tapShortcut Input.
- Tap on
SSH Keyand tap onShare Public Key. Get the public key to your mac (AirDrop, Handoff Clipboard, Apple Notes will all work).
- make sure
.sshdirectory exists - append public key to
authorized_keysfile - Create a new shortcut
- add action
TEXTwith:
pmset displaysleepnow - add action
Run Shortcut, choose shortcut from previous section
Install public key on Mac
Assumes public key is on the clipboard.
mkdir -p ~/.ssh
pbpaste >> ~/.ssh/authorized_keys
Create a shortcut to put Mac Display to sleep
Now when you run the shortcut, your display will go to sleep.
#NovBaD #NaBloPoMo #challenge2of30 #challenge #automation #shortcuts #iOS #macOS #SSH





















