Permission Denieid with IOProtocolExt SCP or SFTP

Help
mr_sarge
2014-02-03
2014-02-03
  • mr_sarge
    mr_sarge
    2014-02-03

    Hi,

    I'm trying to use this plugin but can get it to work. It download the DB, sync it, but when it reupload, it create a "MyDatabaseName.kdbx.tmp", erase the original "MyDatabaseName.kdbx" and I then get this error message:

    Error moving file 'MyDatabaseName.kdbx.tmp' to '/MyDatabaseName.kdbx'.
    Command 'mv -f "MyDatabaseName.kdbx.tmp" "/MyDatabaseName.kdbx"'
    failed with return code 1 and error message
    mv: cannot move 'MyDatabaseName.kdbx.tmp' to '/MyDatabaseName.kdbx': Permission denied.

    The remote folder is my home directory on the server. So I have full priviledge on the folder. If I log in the server in SSH, I can mv the file manually. If I try to do a "Move To" manually in WinSCP to "./MyDatabaseName.kdbx" it work.

    Did I miss something?

    Thank you,

    Mr_sarge

     
    Last edit: mr_sarge 2014-02-03
  • Dominik Reichl
    Dominik Reichl
    2014-02-03

    If you cannot configure the server to allow this, you might want to disable the option 'Use file transactions for writing databases' (in 'Tools' -> 'Options' -> tab 'Advanced'), KeePass will then directly write the file.

    Best regards,
    Dominik

     
  • mr_sarge
    mr_sarge
    2014-02-03

    Thanks for your input. I prefer to keep the transaction file, but it's a good idea.

    I just saw that the plugin try to mv the file to "/" , the root of the drive. My user don't have access to this. The plugin should instead move without any direcory instruction:

    mv -f MyDatabaseName.kdbx.tmp MyDatabaseName.kdbx

    For now, I've edited the source of the plugin and recompiled it. In "WinScpWebRequest.cs", I replaced this line:

    sbScript.AppendLine("mv \"" + strRemoteFile + "\" \"" + uriTarget.AbsolutePath + "\"");

    by this:

    sbScript.AppendLine("mv \"" + strRemoteFile + "\" .\"" + uriTarget.AbsolutePath + "\"");

    So the file is moved into the actual directory (that is my home direcotory).

    And rebuilted it with this:

    keepass.exe --plgx-create C:\IOProtocolEXT-1.8-Source

    Everything work perfectly now.

    Thank you!

     
    Last edit: mr_sarge 2014-02-03