Skip to main content
Esteemed Contributor III
Apr 29, 2008 3:52 PM UTC
Question

VPN pre-shared key

Just wondering if anybody else experienced this: The only way I can get the pre-shared key to work is if I manually enter the pre-shared key into the FortiGate (copy and paste won' t work). I want a really complex randomly generated key and it takes a really long time to enter it in manually. I am able to copy and paste that same pre-shared key into the Forti-Client which saves some time. But I could save more time if I could copy and paste it into the FortiGate.

    15 replies

    freaky
    New Member
    Apr 29, 2008 6:07 PM UTC
    Never had those issues, but I did have issues with special chars (about 1-2 year ago tho' haven' t tested it with recent versions). So I don' t use special chars anymore. Pasting things like this always goes fine for me tho' (linux pwgen -s 40 1): lzcgpIiSndD5mRO0f0lrLIhJtHbG0RGAdVo4NfEJ
    Translate
    Esteemed Contributor III
    Apr 29, 2008 8:40 PM UTC
    Paul, I have had some issues before with Fortimanager where I copied and pasted a password and it failed. When typing the password by hand (and comparing to the clipboard to make sure it matched) it worked. No workaround at this point.
    Translate
    rwpatterson
    New Member
    Apr 30, 2008 12:30 PM UTC
    Take a look at the backup file. The pre-shared key is encrypted. You can paste this encrypted version into another box in the correct area, and be done with the whole mess...
    Translate
    mhe
    Explorer II
    Apr 30, 2008 12:54 PM UTC
    You can copy the PSK using the cli: config vpn ipsec phase1 edit " yourphase1" set psksecret yourverycomplexpsk next end martin
    Translate
    Esteemed Contributor III
    Apr 30, 2008 4:08 PM UTC
    I think what Paul is mentioning is the following: -Create a random pre-shared key -Copy and paste the random key into the Web GUI so before you even get to the stage of copying it to other units. Let' s say you email the key to the other side that is using a non-Fortigate unit. So potentially the pre-shared keys don' t match. I have run into this before also where I had to manually retype the admin password into Fortimanager, copy and paste inserted something into the admin password field but not the admin password ;)
    Translate
    Esteemed Contributor III
    Apr 30, 2008 6:26 PM UTC
    loorimar, Yes, that' s exactly what I mean. I have to manually type it in to the FortiGate to get it to work. I' m going to try mhe' s suggestion and copy-and-paste it using the CLI. I found out something when I did that: there is an 80 character limit. NOTE: This was not a problem I had before since I only tested it out with a 24 character PSK before. I know Windows has a 256 character limit for passwords so that' s what I like to use for ultimate security. I' ll test out the VPN tonight and see it the copy-and-paste in the CLI works.
    Translate
    rwpatterson
    New Member
    Apr 30, 2008 7:40 PM UTC
    I' ll test out the VPN tonight and see it the copy-and-paste in the CLI works.
    Only if both units are Fortigates, for sure....
    Translate
    Esteemed Contributor III
    May 1, 2008 12:54 PM UTC
    OK, I tried the copy and paste in the CLI but that didn' t work either. Just to clarify what I mean if anybody is still confused, I CAN copy and paste into the GUI and the CLI, but when I do, the VPN doesn' t work. Anyway, my VPN does work so I shouldn' t really complain. I created a random 80 character password, entered it manually into the FortiGate, copied and pasted it into the FortiClient, and the VPN works.
    Translate
    abelio
    SuperUser
    SuperUser
    May 1, 2008 2:18 PM UTC
    Just to clarify what I mean if anybody is still confused, I CAN copy and paste into the GUI and the CLI, but when I do, the VPN doesn' t work.
    is important to re-check charset matching between source terminal (where Copy takes place) and destination terminal (FGT console, SSH console, etc where Paste happens); ISO-UTF8, ISO-8859-1, ISO-8859-15, Hyperterminal ascii configuration etc all things to re-check if your PSK includes so long characters sequence and if you use non-common characters.
    Translate
    Esteemed Contributor III
    May 1, 2008 2:35 PM UTC
    I used uppercase, lowercase, and special characters in the pre-shared key and it worked OK when I typed them into the FortiGate. I' ll check to see the character set between the source and destination are the same to see if that caused problems with the copy-and-paste. It might save me some time if anybody can tell me what format Notepad (my source) uses and what format the FortiGate (my destination) uses.
    Translate
    abelio
    SuperUser
    SuperUser
    May 1, 2008 3:08 PM UTC
    Notepad alphabet and charset are windows configurable. Same thing the application terminal you use to access yor FTG, hyperterminal, SSH, whatever; i.e. hyperterminal has a conf setting to deal with more than 80 chars lines, if break line or not, these kind of things; I am not saying that it' s your situation, but you' re using long PSK with extended chars. Try a vpn test copy and pasting some shorter PSK with basic characters to see what' s happening
    Translate
    Esteemed Contributor III
    May 1, 2008 3:09 PM UTC
    Abelio, what Paul and I have seen is this scenario: -Create a random password in Notepad -Copy to Windows Clipboard -Paste into Fortinet Web GUI in IE or Firefox So it' s not a case of pasting into any type of terminal application, it' s simply copying and pasting from notepad to Internet Explorer or Firefox (I have seen this with both browsers so that would indicate it' s a FW GUI issue).
    Translate
    Esteemed Contributor III
    May 1, 2008 3:13 PM UTC
    FYI, this also happens with shorter passwords, say 10-16 characters.
    Translate
    abelio
    SuperUser
    SuperUser
    May 1, 2008 5:52 PM UTC
    Ok, sorry loorimar, i couldn' t reproduce the error you' ve described; I' ve used only Firefox (linux and ' vmwared' -windowsXP only)
    Translate
    rwpatterson
    New Member
    May 2, 2008 12:34 PM UTC
    Use Wordpad. Notepad does some funny Windows crap to things....
    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024