Expand description
Auto SSH Key Setup
Provides automated SSH key generation and server configuration for transitioning from password-based to key-based authentication.
§Safety Invariants
- Never disable password authentication without verified key auth
- Append to authorized_keys, never overwrite
- Always backup sshd_config before modification
- Show warning about alternative access before disabling password
- Log all operations to key_setup.log
- Private key 600, .ssh directory 700
- Never transmit private key over network
Structs§
- KeySetup
Machine - State machine for tracking key setup progress.
- KeySetup
Result - Result of the key setup process.
Enums§
- KeySetup
State - Result of the key setup process.
- KeySetup
Step - Individual steps in the key setup process.
- KeyType
- Supported SSH key types for generation.
Functions§
- build_
authorized_ keys_ command - Builds the command to append a public key to authorized_keys.
- build_
disable_ password_ command - Builds the command to disable password authentication in sshd_config.
- build_
reload_ sshd_ command - Builds the command to reload the SSH daemon.
- build_
rollback_ command - Builds the emergency rollback command.
- generate_
key_ pair - Generates an Ed25519 SSH key pair and writes it to disk.
- sanitize_
hostname - Sanitizes a hostname for use in a key filename.
- setup_
key_ for_ host - Executes the complete key setup process for a host.