Topic "Open session in GUI and pass master password from Keepass"

Author Message
m4rk
[View user's profile]

Joined: 2013-07-11
Posts: 6
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 Smile

Thanks Mark
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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.

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


See http://winscp.net/eng/docs/commandline
_________________
Martin Prikryl
m4rk
[View user's profile]

Joined: 2013-07-11
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
m4rk
[View user's profile]

Joined: 2013-07-11
Posts: 6
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 Very Happy
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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.
_________________
Martin Prikryl
Sebastian

Guest


After fiddling for hours with KeePass, WinSCP and tunneling this finally closed the last gap in my setup!
Thanks so much. It took me a long time to find the "rawsettings" option in WinSCP and then how to open the GUI instead of a console.
In the end all you need can be found here:
http://winscp.net/eng/docs/rawsettings
http://winscp.net/eng/docs/scripting
and in this topic.

Very good job prikryl! Smile
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License