Show the latest WireGuard handshake timestamp for every peer
Build a paste-ready command, then review its compatibility and effects before running it.
sudo wg show all latest-handshakesread-onlyrequires privileges Compatibility
Unix timestampsThe final column is epoch seconds; zero means no successful handshake has been recorded.
Operational knowledgereview due 2027-01-19
Requirementswgwg must be installed and available on PATH.Elevated accessReview the exact scope before using an elevated account.
Version supportwg Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalswg0 8R1m3z7pQ2x4kL9sV6nB0cD5eF1gH8jK4aQ= 1784797352Representative successful output; values vary with the selected target and system state.
Known errorswg: command not foundwg is missing or is not available on PATH.Permission deniedThe current identity does not have the required access.
Verifysudo wg show all latest-handshakesThe output matches the expected target and exits without an error.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01sudoPrivilege elevationRuns the following command with elevated privileges after authorization.
02wgCommandRuns the wg stage of this one-liner.
03showArgumentPasses show to wg.
04allArgumentPasses all to wg.
05latest-handshakesArgumentPasses latest-handshakes to wg.
Example input
sudo wg show all latest-handshakes
Example output
wg0 8R1m3z7pQ2x4kL9sV6nB0cD5eF1gH8jK4aQ= 1784797352
wg0 4G9p2mN7bV1cX5zL8kJ3hF6dS0aQ9wE2rT= 0
Illustrative output — exact values vary by system and data.
Official sources
Related commands