I was hoping to configure a keystroke command using BetterTouchTool to open a terminal window and run an ssh session. I do this a lot to connect to a RaspberryPi on my network. The execute terminal command seems to execute the command without opening a window, and all the help I can turn up on Google is people asking how to run commands without opening a window. So what would be the best method for me to open a terminal window and execute ssh pi@10.0.0.x in that window?
MacOS – Open an ssh session in terminal with BetterTouchTool
bettertouchtoolmacossshterminal
Related Question
- Can a SSH session be wrapped to appear as a distinct App
- How to unfreeze terminal when SSH connection dies
- MacOS – .bash_profile not updating until open new Terminal window
- MacOS – How to communicate with another computer (on another network) terminal to terminal (OS X )
- How to prevent Mac terminal ssh from disconnecting when the screen is automatically turned off
- Open terminal via Safari
- Detaching Process from “Run Script Over SSH” in Shortcuts
Best Answer
So, if I understand you correctly, you want to just click on a shortcut on your Desktop (or somewhere else) that will open Terminal.app and connect to a particular host via SSH.
The quickest way would be to create an AppleScript that opens Terminal and executes the command
ssh <user>@<ipaddress>
First... Here's the code you are going to need:
Make sure you change the "user" and "host" to its appropriate values; your username and the host/ip address you wish to connect to.
You have to put that into an AppleScript script then "bundle" it as an Application.
Open AppleScript Editor
You can find AppleScript Editor in the Utilities folder, but I find it much easier to hit Command + Spacebar to invoke Spotlight Search and just start typing "AppleScript" and hitting RETURN when it's found.
Once launched, create a new document and past the code I provided.
Save your Code as an "Application"
When you save your App, save it to your Desktop, give it a useful name and make sure you select "Application." You can ignore the "Options" at the bottom.
Launch Your App...
An icon will appear on your desk with the name that you gave it in the previous step. Click on it to Launch your newly created app.
Results
Your terminal window will launch issuing the command you programmed: