Automatically start Pageant

Advertisement

xmt
Guest

Automatically start Pageant

Hey,

Would it be possible to add an option that if WinSCP can't find Pageant running when "Attempt authentication using Pageant" is enabled, it will start it automatically?

This would be really handy for when I sometimes forget to load up Pageant. Currently one has to cancel the connection, and then reconnect once Pageant has been started.

There would need to be a way to specify the command to execute in order to start the agent, since the only way I've found to make Pageant "remember" keys is to pass them as arguments.

Currently the best solution to this I've come up with is to create two additional shortcuts to Pageant, of the form...
"C:\Program Files (x86)\WinSCP\PuTTY\pageant.exe" "C:\Users\xxx\Documents\key.ppk" -c "C:\Program Files (x86)\WinSCP\WinSCP.exe"
...one for WinSCP and one for PuTTY, and then the icon can be changed to make the shortcut look like the real deal.

Unfortunately this makes key management a bit of a faff, not to mention it means I now *have* to enter all my passphrases into Pageant even if I wasn't planning to log into a server which required a key.

Thanks for your time.

Ps. Not sure if I should be asking the PuTTY people about this instead, since I'd also really like PuTTY to do this too.

Reply with quote

Advertisement

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

Re: Automatically start Agent

You can configure WinSCP to use the key directly, without using pageant. Wouldn't it be a solution?

Reply with quote

xmt
Guest

Re: Automatically start Agent

martin wrote:

You can configure WinSCP to use the key directly, without using pageant. Wouldn't it be a solution?
Wouldn't that mean I'd need to enter the passphrase every time I wanted to log in? One of the main benefits of using an agent is that I only have to do that once.

Reply with quote

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

Re: Automatically start Agent

xmt wrote:

Wouldn't that mean I'd need to enter the passphrase every time I wanted to log in? One of the main benefits of using an agent is that I only have to do that once.
That's true.

You can as well start both WinSCP and Pageant from one batch file.

Reply with quote

consistency
consistency avatar
Joined:
Posts:
54
Location:
austria

would be great to have such a feature like in tortoisegit with putty. if i start a session where i need my key pageant is startet and prompts me for the passphrase. if i enter it, it is directly stored in pageant. no fiddeling around with batch files to start pageant and winscp with the key.

Reply with quote

Advertisement

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

consistency wrote:

would be great to have such a feature like in tortoisegit with putty. if i start a session where i need my key pageant is startet and prompts me for the passphrase. if i enter it, it is directly stored in pageant. no fiddeling around with batch files to start pageant and winscp with the key.
How does tortoisegit tell that key is needed for that session?

Reply with quote

consistency
consistency avatar
Joined:
Posts:
54
Location:
austria

i don't know how it work exactly in tortoise git, would have to look into the source
but i think it is quite straight:
you have the path to the key saved in your winscp session, so if the session is started a call like "exec(pageant sessionKeyNameWithPath)" sould be enough.
if you exec pageant like this, it will spawn its own password dialog and will keep the key including password in memory until the system is restarted. i don't know how you invoke the key, but i think you invoke it internal in winscp, rather then just sending the path to pageant.

Reply with quote

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

consistency wrote:

i don't know how it work exactly in tortoise git, would have to look into the source
but i think it is quite straight:
you have the path to the key saved in your winscp session, so if the session is started a call like "exec(pageant sessionKeyNameWithPath)" sould be enough.
if you exec pageant like this, it will spawn its own password dialog and will keep the key including password in memory until the system is restarted. i don't know how you invoke the key, but i think you invoke it internal in winscp, rather then just sending the path to pageant.
OK, so you have to specify the key in the session. Because in general, you do not have to. WinSCP tries to use any key loaded into pageant.

This request has been added to the tracker:
https://winscp.net/tracker/738

Reply with quote

consistency
consistency avatar
Joined:
Posts:
54
Location:
austria

martin wrote:


OK, so you have to specify the key in the session. Because in general, you do not have to. WinSCP tries to use any key loaded into pageant.
oh i see, i used to define my key in the "private key file" field of the winscp session. maybe you just can add the functionality with calling the pageant, if a key is specified in this field.
or add a checkbox force loading with pageant.

thanks for adding to the bug tracker

Reply with quote

Advertisement

consistency
consistency avatar
Joined:
Posts:
54
Location:
austria

push

if you use a lot of different keys, it is really important having this feature.

currently, after a network disconnect (computer hibernation), i have to enter all passphrases for the keys again (on all winscp connections and all putty sessions (using reconnect)).

would be great having winscp let pageant load the key, so it stays in memory after hibernation.

Reply with quote

Advertisement

You can post new topics in this forum