Smart 2FA Manager v1.1.0

Lightweight, offline, independent TOTP 2FA manager for Linux

Pure bash implementation — No cloud, no phone required. Store your secrets locally, generate codes, create encrypted backups, and sync with Google Authenticator via QR codes.

Bash TOTP GPG Linux Offline QR Codes

Lightweight, offline, independent TOTP 2FA manager for Linux. No cloud, no phone required. Store your secrets locally, generate codes, create encrypted backups, and sync with Google Authenticator via QR codes.

Dependencies:

# Arch Linux
sudo pacman -S oath-toolkit gnupg qrencode

# Debian/Ubuntu
sudo apt install oathtool gpg qrencode

# Fedora/RHEL
sudo dnf install oathtool gnupg2 qrencode

Setup:

cd ~
git clone https://github.com/smartlegionlab/smart-2fa-manager-bash.git
cd smart-2fa-manager-bash

chmod +x 2fa.sh
sudo cp 2fa.sh /usr/local/bin/2fa.sh

# Initialize (first launch only!)
2fa.sh init

CommandDescription
initCreate encrypted storage
add <service> <secret>Add a new service
get <service>Generate TOTP code (copies to clipboard)
listList all service names
show-allList all services with current codes
del <service>Delete a service
showShow all secrets in plain text (⚠️ unsafe)
qr <service>Show QR code to scan with phone
backupCreate encrypted backup with timestamp
restore <file>Restore from encrypted backup
aboutShow author, repository and license info
versionShow version number
helpShow help message

# Initialize storage (first launch only!)
2fa.sh init

# Add a service (secret from website QR code)
2fa.sh add github JBSWY3DPEHPK3PXP

# Get TOTP code (auto-copies to clipboard)
2fa.sh get github

# Show all services with current codes
2fa.sh show-all

# Export QR code to phone (Google Authenticator / Aegis)
2fa.sh qr github

# Create encrypted backup
2fa.sh backup

# Restore from backup
2fa.sh restore ~/.2fa/backups/secrets.2026-04-06.gpg

~/.2fa/
├── secrets.gpg          # Encrypted master storage
└── backups/
    └── secrets.2026-04-06_14-30-00.gpg

  • Secrets are stored locally in ~/.2fa/secrets.gpg (AES-256 encrypted with GPG)
  • No internet connection required — codes generated locally using oathtool
  • Backups are encrypted with the same password
  • QR codes let you import secrets into Google Authenticator / Aegis
  • Lost your phone? Just re-scan QR codes from your Linux machine

  • Your GPG password is never stored
  • Backup files are encrypted with the same password
  • 2fa.sh show displays all secrets in plain text — use in secure environment only
  • Keep backups in a safe place (encrypted USB drive, offline storage)

Cross-platform 2FA Management Ecosystem: