# Generates a new private RSA SSH key at ~/.ssh/id_rsa with an optional comment.
# Comment defaults to USER@hostname.
function sshnewkey --argument-names comment
    if test -z $comment
        set comment "$USER@"(hostname)
    end

    set -l keyfile ~/.ssh/id_rsa

    ssh-keygen \
        -t rsa \
        -C $comment \
        -f $keyfile
end

function sshnewkey \
    --description 'Generates a new private SSH key at ~/.ssh/id_ed25519 with an optional comment. Comment defaults to USER@hostname'
    --argument-names comment

    if test -z $comment
        set comment "$USER@"(hostname)
    end

    set -l keyfile ~/.ssh/id_ed25519

    ssh-keygen \
        -t ed25519 \
        -C $comment \
        -f $keyfile
end

Switch SSH key generation to use ed25519
Switch SSH key generation to use ed25519
phatblat/dotfiles,phatblat/dotfiles,phatblat/dotfiles,phatblat/dotfiles,phatblat/dotfiles,phatblat/dotfiles