kvm-vm-add-sshkey

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 6 Imported by: 0

README

kvm-vm-add-sshkey

kvm-vm-add-sshkey is a command-line tool that adds an SSH public key to a KVM (Kernel-based Virtual Machine) virtual machine by writing directly to the guest disk while the VM is stopped.

Features

  • Appends an SSH public key to the specified user's .ssh/authorized_keys file inside the guest
  • Verifies that the target virtual machine is stopped before proceeding
  • Sets appropriate ownership and permissions for SSH files

Notes

  • This tool requires permissions to run virsh and virt-customize commands with sudo.
  • Ensure that the target virtual machine is stopped before running this tool.
  • If an authorized_keys file already exists, the new public key will be appended to it. Existing keys will be preserved.

Usage

Basic usage:

$ kvm-vm-add-sshkey [options] VM_NAME

Example:

$ kvm-vm-add-sshkey -user myuser -key /path/to/my/key.pub my-vm

License

This project is licensed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL