Open session in GUI and pass master password from Keepass

Advertisement

m4rk
Joined:
Posts:
6

Open session in GUI and pass master password from Keepass

Hi,
I am trying to open a WinSCp session to my NAS directly from Keepass password manager and avoid having to type the either a master password or the session user name and password.

In Keepass I have created a button to open WinSCP and pass command line arguments. With keepass I can also automatically extract the WinSCp master password from the Keepass secure database, or user name and password, and pass it as an argument.

eg Keepass Action

File.... C:\Program Files\WinSCP\WinSCP.exe
Arguments..... /console /script=c:/script.txt /parameter {REF:P@I:'password reference'}

where script.txt contains

open SFTP://'username':%1%@url:port -timeout=220 -rawsettings ProxyMethod=3 ProxyHost=url ProxyPort='port' ProxyUsername='username' ProxyPassword='password'

I am doing this through a proxy hence the use of the -rawsettings switch!!!

This successfully starts Winscp, opens the url and completes authentication.

I post it because it was a successful test and might be useful for some wishing to create Keepass buttons to start a Winscp session in console without typing session passwords!

But I want to open WinSCP session with the user interface GUI!!!

If I use the argument in Keepass
'WinSCP Session name'

This opens the session in the gui but I cannot find a away to either pass on the masterpassword or pass the session password from Keepass by command line.

Is it possible to open a session in WinSCP GUI and pass either the session user name and password or a master password?

Any tips are welcome but I am am novice and so I may ask more stupid questions :-)

Thanks Mark

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: Open session in GUI and pass master password from Keepass

m4rk wrote:

Is it possible to open a session in WinSCP GUI and pass either the session user name and password
Sure. Just use the same arguments directly on WinSCP command-line as you are now using for open command. Documented way is to use slashes for the switches on command-line (as opposite to dashes in script), like /rawsettings, not -rawsettings, but WinSCP actually supports both.

winscp.exe sftp://username:password@host:port /timeout=220 /rawsettings ProxyMethod=3 ProxyHost=url ProxyPort=port ProxyUsername='username' ProxyPassword='password'

See https://winscp.net/eng/docs/commandline

Reply with quote

m4rk
Joined:
Posts:
6

Hi,

Yes that works now. Thanks.

I take it that it's not possible to use the master password and session name instead? This would avoid having add the proxy details in the command line

Reply with quote

m4rk

Just wanted to add.... I now have a little button in keepass. With one click of said button WinSCP opens up on my remote target folder via SFTP. Super, and I hope secure. All passwords are held within keepass secure database.

Thanks to all who make such things possible :D

Reply with quote

martin
Site Admin
martin avatar

m4rk wrote:

I take it that it's not possible to use the master password and session name instead? This would avoid having add the proxy details in the command line
No, it's not.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum