Skip to main content
New Contributor III
April 29, 2008
Question

VPN pre-shared key

  • April 29, 2008
  • 10 replies
  • 28364 views
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.

    10 replies

    freaky
    New Member
    April 29, 2008
    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
    New Contributor III
    April 29, 2008
    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.
    rwpatterson
    New Member
    April 30, 2008
    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...
    mhe
    Explorer II
    April 30, 2008
    You can copy the PSK using the cli: config vpn ipsec phase1 edit " yourphase1" set psksecret yourverycomplexpsk next end martin
    New Contributor III
    April 30, 2008
    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 ;)
    New Contributor III
    April 30, 2008
    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.
    rwpatterson
    New Member
    April 30, 2008
    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....
    New Contributor III
    May 1, 2008
    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.
    abelio
    SuperUser
    SuperUser
    May 1, 2008
    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.
    New Contributor III
    May 1, 2008
    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.
    abelio
    SuperUser
    SuperUser
    May 1, 2008
    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
    New Contributor III
    May 1, 2008
    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).
    New Contributor III
    May 1, 2008
    FYI, this also happens with shorter passwords, say 10-16 characters.
    abelio
    SuperUser
    SuperUser
    May 1, 2008
    Ok, sorry loorimar, i couldn' t reproduce the error you' ve described; I' ve used only Firefox (linux and ' vmwared' -windowsXP only)
    rwpatterson
    New Member
    May 2, 2008
    Use Wordpad. Notepad does some funny Windows crap to things....