Created on
08-09-2024
06:31 AM
Edited on
12-26-2024
12:36 AM
By
Anthony_E
Description | This article describes how to recover an IPsec pre-shared key in plain text format using the FortiGate API. |
Scope | FortiGate. |
Solution |
Note: This article assumes that the admin has an IPsec tunnel set up with a pre-shared key defined, but has forgotten the actual plain text of that key. For demonstration purposes, this article will use a VPN tunnel with a pre-shared key of 'My_PSK'. Although the pre-shared key 'My_PSK' is known for this example, the focus is to help the admin recover the pre-shared key in plain text format.
Log in into the FortiGate GUI using the super_admin profile:
Open a new tab in the browser (such as Firefox or Google Chrome) and use the following path to obtain the PSK in plain text:
https://FortiGate_IP/api/v2/cmdb/vpn.ipsec/phase1-interface?plain-text-password=1
Another way to recover the forgotten IPsec tunnel preshared key is by creating a dummy SSID and changing the encrypted key in SSID using the tunnel preshared key. Click on the below link and reference the article: Technical Tip: How to recover the plain text version of an IPsec pre-shared key |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.