Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Sebastian

This saved my day!

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:
https://winscp.net/eng/docs/rawsettings
https://winscp.net/eng/docs/scripting
and in this topic.

Very good job prikryl! :)
martin

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.
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
m4rk

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
martin

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
m4rk

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