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
ssh
and selectRun Script Over SSH
. - Tap
Show More
. - In the
Authentication
section, selectSSH Key
. Shortcuts will automatically generate a key for you. - Tap
Script
and swipe above keyboard and tapShortcut Input
. - Tap on
SSH Key
and tap onShare Public Key
. Get the public key to your mac (AirDrop, Handoff Clipboard, Apple Notes will all work). - make sure
.ssh
directory exists - append public key to
authorized_keys
file - Create a new shortcut
- add action
TEXT
with:
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
Dan Sturm liked this article on twitter.com.
Douglas Beal mentioned this article on dougbeal.com.
π·dougbealπ΄ https://dougbeal.com mentioned this article on twitter.com.
Douglas Beal mentioned this article on dougbeal.com.
I found out an action to run script over SSH on iOS Shortcuts, but I have no idea how to import a key.
dougbeal.com/2019/11/02/remβ¦