Forrest logo
back to the wg tool

wg:tldr:0b702

wg: Generate a new private key.
$ wg genkey
try on your machine

The command "wg genkey" is used to generate a new private key for WireGuard, a modern VPN (Virtual Private Network) protocol. This command is executed in the command-line interface (CLI).

When you run "wg genkey", it generates a new private key using a cryptographic algorithm. This private key is essential for setting up a WireGuard connection as it is used for encrypting and decrypting traffic, as well as establishing secure connections between devices.

The generated private key is typically a long string of characters that are used to uniquely identify your device. It is highly recommended to keep this private key secure and not share it with others.

After generating the private key with "wg genkey", you may need to use other commands (such as "wg pubkey") to derive the corresponding public key, which is needed to establish secure communication with other devices in a WireGuard network.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the wg tool