Tuesday, November 11, 2025

System verification token generator

 To generate the system uniq verification token, this script is useful.

  1 #!/usr/bin/env bash

  2

  3 date; hostname; whoami

  4 echo "==== UNIQUE SYSTEM DATA ===="

  5

  6 MACHINE_ID=$(cat /etc/machine-id 2>/dev/null)

  7

  8 # Extract only the SHA256:... field (2nd column)

  9 SSH_FINGERPRINT=$(

 10   sudo ssh-keygen -E sha256 -lf /etc/ssh/ssh_host_ed25519_key.pub 2>/dev/null | awk '{print $2}'     \

 11   || sudo ssh-keygen -E sha256 -lf /etc/ssh/ssh_host_rsa_key.pub 2>/dev/null | awk '{print $2}'

 12 )

 13

 14 MAC_ADDR=$(ip -o link show | awk '/state UP/ {print $17; exit}')

 15

 16 echo "MACHINE_ID: $MACHINE_ID"

 17 echo "SSH_FINGERPRINT: $SSH_FINGERPRINT"

 18 echo "MAC_ADDR: $MAC_ADDR"

 19 echo "==== INTEGRITY TOKEN ===="

 20 echo -n "$MACHINE_ID|$SSH_FINGERPRINT|$MAC_ADDR" | sha256sum


This is a sample output from RHEL9 system.

==== UNIQUE SYSTEM DATA ====

MACHINE_ID: f43083724be44df1bc25f2ea2085573a

SSH_FINGERPRINT: SHA256:Fu9p23zGRT0cLNPkhAzucOkd1WoSS4PSGs+uHypGWNg

MAC_ADDR: bc:24:11:66:6b:e2

==== INTEGRITY TOKEN ====

442639a0fa25633b0dd66d5111768a92eb7263a4039df8b299da9bb092bc389f  -


For the verification, contact me!

Download the files:

1. Generator: Download Link

2. Verifier: contact - sslab@lewisu.edu


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Popular Posts