Skip to content

Instantly share code, notes, and snippets.

@melmatsuoka
Created June 12, 2023 12:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melmatsuoka/7c8bee12c64096d462db128633b7c3da to your computer and use it in GitHub Desktop.
Save melmatsuoka/7c8bee12c64096d462db128633b7c3da to your computer and use it in GitHub Desktop.
This automatically outputs the concatenated OTP+Password that the OPNsense admin login fields expects when you're using a 2FA protected account. Requires 1Password CLI
#!/usr/bin/env bash
vault_item_uuid="YOUR VAULT ITEM UUID"
opnsense_otp=$(op item get ${vault_item_uuid} --otp)
opnsense_pwd=$(op item get ${vault_item_uuid} --fields password)
# "pbcopy" is a macOS only built-in that copies whatever was piped to it to the system clipboard
echo -n "$opnsense_otp$opnsense_pwd" | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment