Editing
WireGuard
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= WireGuard = == Key Management (wg) == The `wg` utility provides everything required to generate and manage WireGuard key material. === Generate a Private Key === Generate a new private key: <pre> wg genkey </pre> Save it to a file: <pre> wg genkey > private.key </pre> === Derive a Public Key === A WireGuard public key is always derived from the private key. Generate the corresponding public key: <pre> wg pubkey < private.key </pre> Save it: <pre> wg pubkey < private.key > public.key </pre> === Generate a Key Pair === Generate both the private and public key in one command: <pre> wg genkey | tee private.key | wg pubkey > public.key </pre> === Generate a Preshared Key (PSK) === Generate a new preshared key: <pre> wg genpsk </pre> Save it: <pre> wg genpsk > psk.key </pre> === Notes === * Every WireGuard interface has a single '''private/public key pair'''. * Every peer has its own '''public key'''. * A '''PresharedKey''' is optional and unique per peer. * Public keys are deterministic and can always be regenerated from the private key. * Only the private key must remain secret. * Public keys are safe to share. * PSKs must be configured identically on both peers.
Summary:
Please note that all contributions to The Incoherency.Net Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
The Incoherency.Net Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
associated-pages
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main Page
Recent changes
Random page
Denis Lemire's Site
Help
Tools
What links here
Related changes
Page information