wg:tldr:a9b38
The command "wg pubkey < ${path-to-private_key} > ${path-to-public_key}" is used to generate a WireGuard public key from a corresponding private key.
Here is a breakdown of the command:
-
"wg pubkey": This is the WireGuard command used to generate the public key.
-
"< ${path-to-private_key}": The "<" symbol is used for input redirection, and "${path-to-private_key}" represents the path to your private key file. This part of the command redirects the content of the private key file as input for the "wg pubkey" command.
-
"> ${path-to-public_key}": The ">" symbol is used for output redirection, and "${path-to-public_key}" represents the path where you want to save the public key. This part of the command redirects the output generated by the "wg pubkey" command and saves it into the specified file as the public key.
In summary, the command takes the private key file as input, uses the "wg pubkey" command to generate the public key, and saves it to the specified location.