Last active
October 8, 2025 21:50
-
-
Save ernstki/f26a114096db1f31901252070caf3567 to your computer and use it in GitHub Desktop.
rdscert - list Windows Remote Desktop machine certs in the format used by Remmina on Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| HASHALG=sha256 | |
| files=() | |
| args=(-$HASHALG) | |
| while (( $# )); do | |
| case $1 in | |
| -*) | |
| for arg in "${args[@]}"; do | |
| if [[ $1 == $arg ]]; then | |
| echo "WARNING: Duplicate argument '$1'; ignoring" >&2; | |
| shift; continue | |
| fi | |
| done | |
| args+=("$1") | |
| ;; | |
| *) | |
| if [[ ! -r $1 ]]; then | |
| echo "WARNING: Unreadable file '$1'" >&2 | |
| shift; continue | |
| fi | |
| files+=("$1") | |
| ;; | |
| esac | |
| shift | |
| done | |
| if [[ -z "${files[@]}" ]]; then | |
| echo "usage: rdscert [openssl x509 args] CERTFILE [CERTFILE...]" >&2; | |
| fi | |
| for cert in "${files[@]}"; do | |
| ( set -x; openssl x509 -fingerprint "${args[@]}" -in "$cert" ) \ | |
| | sed '/--*BEGIN/,/--*END/d' | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run
certlm.mscfrom the Start menu, or search for "certificates" and then click "Manage computer certificates." (ref)Then, browse to Remote Desktop → Certificates in the left-hand pane. In the right-hand pane, right click on the certificate for your local machine and export it to a
.cerfile somewhere.Run the above script on it like so: