Files
dotfiles/zsh/.local/share/zsh/functions/ssh-keygen-new
2025-10-20 19:44:10 +00:00

8 lines
238 B
Plaintext

function ssh-keygen-new() {
local key_type="${1:-ed25519}"
local key_file="${2:-$HOME/.ssh/id_${key_type}}"
local comment="${3:-$(printf '%s@%s' $(whoami) $(hostname))}"
ssh-keygen -t "$key_type" -f "$key_file" -C "$comment"
}