HowTo:SFTP(solved "invalid charact...

  • DaKarli

    DaKarli - 2012-09-17

    Hi to all who have problems getting SFTP to run!

    Some of you already claimed problems with invalid characters, debuging SFTP
    connections, and wondering why it didn't work.

    It really is a fault of the developer (sorry for blaming!) not to document
    usage correctly while the solution is so easy. Don't you want your users to
    use your plugin? Ok, on to something productive:

    1. The directory you are sitting in, when you connect to your server with WinSCP (or something else) will usually be your Home or Base directory. The path from this directory to the directory where your *.kdbx file sits is the path you have to put into the "Directory" field in the PlugIn GUI. For example from your Home you have to go to "/files/secret/KeepassDB" to find your KeePass database, then your path will be:


    1. Now, while in WinSCP, you would upload your Keepass file to your a.m. path. And now comes the whole trick:
      Just rename the file on the server to exactly this:


    Replace "NAMEofYOURdbHERE" with the name you want/have.

    1. Ensure to manually put PLINKs path into the PlugIn GUI as "Keepass Root" won't work.

    2. Try to connect and you will see the magic. It works!

    Comment for the developer:
    After some syncs the plugin looses its path to plink, so this problem still
    And please add my lines to your helpfile inside the plugin.

    And something would be nice as an improvement:
    The database should not only sync when pressing the save button but also sync
    (or ask before) closing Keepass. Because if you close Keepass (with autosave
    enabled) the database will be saved locally but is not in sync with the
    server. So next time you open the DB you have to remember to sync with your
    server manually. Now just imagine if you open your database somewhere else in
    the meantime and change something inside the DB. Going back to the original
    machine you will find your DB messed up or corrupt or not just right.


    • DaKarli

      DaKarli - 2013-06-04

      Just a small addition to the a.m.:

      My problem was, that I didn't authenticate to my server with a password and instead used a SSH key. In order to configure this correctly just follow my additional instructions here (they are somehow included in the KeePassSync-readme.txt as well).

      So in short terms:

      1. Install KeePass and the PlugIn KeePassSync.

      2. Add your Host and Port to the KeePassSync Options, activate PAGEANT (from the PuTTY Tools), set Directory and add PLINK path as mentioned above

      3. Import your SSH keys to PAGEANT

      4. Open a CMD prompt and go to the PLINK path. Now open a connection to your server once like this:

        plink your_user_name@your_server -P your_server_port -agent

      5. If you get asked to store the server key, answer yes. Now you should
        find yourself connected to the server with a command prompt. You could
        now look for the KeePass database you uploaded to your server before,
        if you like.

      6. Close this connection after that with "exit".

      7. Ensure, that PAGEANT is started and you can see your keys with "View Keys".

      8. Now, if you followed all my instructions, you can try to Sync with KeePassSync.

      It should work.

      In case you use password authentication, my instructions will still work. Just leave out the PAGEANT sections and connect to your server with PLINK as follows:

      plink -pw your_password your_user_name@your_server -P your_server_port

      I hope I could help some of you who don't like to sync passwords to any Cloud services.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks