Skip to content

Instantly share code, notes, and snippets.

@mrl22
Created December 10, 2025 11:34
Show Gist options
  • Select an option

  • Save mrl22/e52f2a541c4e1e4a53880d93f2232c62 to your computer and use it in GitHub Desktop.

Select an option

Save mrl22/e52f2a541c4e1e4a53880d93f2232c62 to your computer and use it in GitHub Desktop.
RoyalTSX SSH Wrapper for Mac Terminal - PasswordAuthentication only.
#!/usr/bin/env bash
# sshh - Royal TSX launcher wrapper
set -euo pipefail
port=""
target=""
# Parse args
while [ "$#" -gt 0 ]; do
case "$1" in
-p)
shift
port="$1"
;;
-*)
# ignore other flags
;;
*)
target="$1"
;;
esac
shift
done
if [ -z "${target}" ]; then
echo "Usage: sshh [-p port] user@host" >&2
exit 1
fi
case "${target}" in
*@*)
user="${target%@*}"
host="${target#*@}"
;;
*)
echo "Target must be in the form user@host" >&2
exit 1
;;
esac
# Build Royal TSX URL
# Base:
# rtsx://ssh%3a%2f%2fuser%3a@host%3a[port]%3a?property_Name=host
url="rtsx://ssh%3a%2f%2f${user}%3a@${host}"
if [ -n "${port}" ]; then
url="${url}%3a${port}"
fi
url="${url}%3a?property_Name=${host}"
# Launch Royal TSX
open -n -F -W "${url}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment