repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell/modules/ssh.nu

Raw
use ./lib.nu *

# Generate a new ed25519 SSH private key
export def ssh-keygen-ed [
    email: string # Identifier for the COMMENT section of the key
] {
  require-binary ssh-keygen
  ssh-keygen -t ed25519 -C $email
}

# Generate public key from private key
export def ssh-keygen-pub [
  key: path # path to private key
] {
  require-binary ssh-keygen
  ssh-keygen -y -f $key | save --raw $"($key + .pub)"
}