How can I integrate WinSCP with BeyondTrust PowerBroker Password Safe?

1

1

I am able to launch WinSCP application and able to pass the hostname as its parameters but failing to do the same for Username and Password. Below are the parameters which I have supplied.

-S %h -U %u -P %p

Instead of 'Retrieve Password', I am using 'Application Session' feature. It opens up WinSCP on that host but could not go past username and password which should be automatic. Like, when I use 'Open SSH', it opens up the Putty and automatically log on to that server.

Update: Image updated as per Mark's way

Vinay Dabas

Posted 2018-05-14T04:38:30.527

Reputation: 11

2Are those even valid commandline switches for WinSCP ? AFAIK passing a username and password is done by setting a url such as sftp://user:password@example.com/ – HBruijn – 2018-05-14T05:02:56.970

@HBrujin - Kindly see my comment below. – Vinay Dabas – 2018-05-15T04:54:06.513

Answers

1

To pass hostname (I assume that's what you mean by -S), username and password on WinSCP command-line, use session URL:

sftp://%u:%p@%h/

WinSCP does not have -S, -U nor -P switches.

Martin Prikryl

Posted 2018-05-14T04:38:30.527

Reputation: 13 764

I was passing these switches in Password Safe's configuration. -S is Session. I tried it your way but not getting it as %u has been read prior to the hostname - it is assuming %u as the hostname. It is working fine if I am running an SQL instance as an application. I have updated the questions with some snapshots. Kindly see. – Vinay Dabas – 2018-05-15T04:53:36.100

Show us screenshots with my way. Screenshots with your way are useless, WinSCP does not understand those parameters. – Martin Prikryl – 2018-05-15T05:10:48.767

I have updated the image your way. – Vinay Dabas – 2018-05-18T05:47:12.070

Then it looks like the %h does not do what you think. Do you have a documentation for patterns that you can use in PowerBroker? – Martin Prikryl – 2018-05-18T06:10:02.310

This is what it says in one of the example: **To do this, set the parameters to: -S %h -d btu_hr_apps -U %u -P %p; At session connection time, the: • %h is replaced by Password Safe with the name of the managed system • %u is replaced by Password Safe with the username for the managed account • %p is replaced by Password Safe with the managed password Note: There are additional variables available, such as: • %i ip address • %t port number • %d database or asset name** – Vinay Dabas – 2018-05-21T06:32:34.930

What is "name of managed system"? Maybe you can try %i instead of %h. – Martin Prikryl – 2018-05-22T10:45:53.137