wg:tldr:aba62
This command can be broken down into several parts:
-
wg genkey
: It runs the "genkey" command of the WireGuard utility. This command generates a WireGuard private key. -
|
: It is a pipe symbol that connects the output of the previous command to the input of the next command. -
tee ${path-to-private_key}
: Thetee
command is used to read from standard input and write to both standard output and files. In this case, it takes the output from the previous command and writes it to a file specified by${path-to-private_key}
. This file will contain the generated WireGuard private key. -
|
: Another pipe symbol used to connect the output of the previous command to the input of the next command. -
wg pubkey
: This command is used to derive the corresponding public key from a given WireGuard private key. -
> ${path-to-public_key}
: This redirects the output of thewg pubkey
command to a file specified by${path-to-public_key}
. This file will contain the generated WireGuard public key.
In summary, this command generates a WireGuard private key using wg genkey
, saves it to a file using tee
, then derives the corresponding public key using wg pubkey
, and finally saves the public key to a different file.