| Crates.io | mnemossh |
| lib.rs | mnemossh |
| version | 0.1.9 |
| created_at | 2025-05-18 10:35:31.72706+00 |
| updated_at | 2025-10-07 08:30:23.447637+00 |
| description | A library and CLI tool for generating and managing Ed25519 SSH keys using BIP-39 mnemonic phrases |
| homepage | |
| repository | https://github.com/abkvme/mnemossh |
| max_upload_size | |
| id | 1678534 |
| size | 126,421 |
MnemoSSH is a Rust-based library and command-line utility designed to generate and manage Ed25519 SSH keys using BIP-39 mnemonic phrases. It provides secure and reproducible key generation from mnemonic phrases, allowing easy backup and recovery of SSH keys.
git clone https://github.com/abkvme/mnemossh.git
cd mnemossh
cargo build --release
The binary will be available at target/release/mnemossh.
MnemoSSH provides four main commands: generate, restore, verify, and version. All commands support both their full name and their aliases (gen, res, ver, and v respectively).
The generate command creates a new mnemonic phrase and uses it to derive an Ed25519 SSH key pair. When run without parameters, it guides you through an interactive process.
Basic usage:
mnemossh generate
With all options:
mnemossh gen -o ~/.ssh/id_ed25519 -c user@example.com -l 24 -m ~/.ssh/mnemonic.txt -p mysecretpass
The restore command recreates an SSH key pair from an existing mnemonic phrase. The mnemonic can be provided as a parameter or entered interactively.
Basic usage:
mnemossh restore
# You'll be prompted to enter the mnemonic phrase
With mnemonic as parameter:
mnemossh restore "abandon ability able about ..."
With all options:
mnemossh res "abandon ability able about ..." -o ~/.ssh/id_ed25519 -c user@example.com -p mysecretpass
The verify command checks that an existing SSH key matches a given mnemonic phrase. The mnemonic can be provided as a parameter or entered interactively.
Basic usage:
mnemossh verify
# You'll be prompted to enter the mnemonic phrase
With mnemonic as parameter:
mnemossh verify "abandon ability able about ..."
With key path specified:
mnemossh ver "abandon ability able about ..." -k ~/.ssh/id_ed25519
mnemossh version
# or simply
mnemossh v
# General help
mnemossh --help
# Command-specific help
mnemossh generate --help
mnemossh restore --help
mnemossh verify --help
MnemoSSH uses an interactive workflow when parameters aren't specified:
The utility includes protection against accidentally overwriting existing SSH keys. When generating or restoring SSH keys to a location where keys already exist:
MnemoSSH provides comprehensive command line options for all operations. Below is a detailed reference of all available commands and their parameters.
--help: Display help information for any command--version: Display version informationgenerate Command (alias: gen)Generate a new mnemonic phrase and SSH key pair.
Parameters:
-o, --output <FILE>: Output file for the private key (public key will be saved as <file>.pub)
~/.ssh/id_ed25519)./id_ed25519)-c, --comment <COMMENT>: Comment to add to the public key (typically an email address)
-p, --passphrase <PASSPHRASE>: Passphrase for encrypting the private key
-l, --length <LENGTH>: Length of the mnemonic phrase (12, 18, or 24 words)
-m, --mnemonic-file <FILE>: Save the mnemonic phrase to a file instead of displaying it
restore Command (alias: res)Restore an SSH key from a mnemonic phrase.
Parameters:
<MNEMONIC>: The BIP-39 mnemonic phrase to restore from (optional)
-o, --output <FILE>: Output file for the private key (public key will be saved as <file>.pub)
~/.ssh/id_ed25519)./id_ed25519)-c, --comment <COMMENT>: Comment to add to the public key (typically an email address)
-p, --passphrase <PASSPHRASE>: Passphrase for encrypting the private key
verify Command (alias: ver)Verify that a key matches a mnemonic phrase.
Parameters:
<MNEMONIC>: The BIP-39 mnemonic phrase to verify (optional)
-k, --key <FILE>: The SSH key file to verify against
~/.ssh/id_ed25519)./id_ed25519)version Command (alias: v)Display version information about the MnemoSSH utility.
Parameters: None
MnemoSSH can be used as a library in other Rust projects:
use mnemossh::{Mnemonic, MnemonicLength, generate_keypair_from_mnemonic};
// Generate a new mnemonic
let mnemonic = Mnemonic::new(MnemonicLength::Words24)?;
// Or restore from an existing phrase
let mnemonic = Mnemonic::from_phrase("abandon ability able about ...")?;
// Generate a key pair
let keypair = generate_keypair_from_mnemonic(&mnemonic, Some("user@example.com"), None)?;
// Save the key pair
let (private_path, public_path) = keypair.save_to_files("~/.ssh/id_ed25519")?;
This project is licensed under the MIT License - see the LICENSE file for details