Topic "How do I use a private key with an INI file"

Author Message
dmalesd
[View user's profile]

Joined: 2006-09-28
Posts: 9
Hi,
I currently run a script using WinSCP.com. The current command line call is
"D:\Program Files\WinSCP3\WinSCP3.com" /privatekey="D:\Program Files\WinSCP3\xxx.ppk" /script="D:\AMW\PollUSD\USDtoAMWScript.txt"

and this works ok. However now I wish to timeout the session after a certain period of time.

After reading other posts about setting a session timeout I gather I have to add a timeout to an INI file and reference the /ini in my command line call to create a session.
After a number of attempts I cannot seem to connect to the server whereby WinSCP uses the key file in the authentication process. It finds the server and (as I have batch turned off in my script file) then I am prompted to verify the "The server's rsa2 key fingerprint". When I reply yes I am still prompted with a password request, when there is no password specified for the username I am using.

My INI session configuration is:
[Sessions\USDtoAMW]
Hostname=xxx.xx.xx.xx
Username=amw-out
PrivatekeyFile="D:\Program Files\WinSCP3\xxx.ppk"
PingType=0
RemoteDirectory=/AMW/Output
TimeOut=30

Any thoughts would be gratefully appreciated. Thanks
David

Last edited by dmalesd on 2006-10-31 13:01; edited 3 times in total
Advertisements
dmalesd
[View user's profile]

Joined: 2006-09-28
Posts: 9
I have since found the solution to the authentication problem. I changed the INI file to :
[Sessions\USDtoAMW]
Hostname=xxx.xx.xx.xx
Username=amw-out
PublickeyFile=D:%5CAMW%5CPollUSD%5Cxxx.ppk
PingType=0
RemoteDirectory=/AMW/Output
TimeOut=30

and said yes to the prompt for adding host key to the cache. After this a new heading [SshHostKeys] appeared in the INI file with the relevant information.
However I don't think this resolves my original problem. Can someone confirm the following:
1) If the timeout relates to the detection of no activity from the remote server and hence ends the session....
2) is there an INI setting relating to detection of activity in the WinSCP client itself. Once the timeout has been reached then the session will end. The problem is WinSCP.com sometimes does not successfully complete key authentication and then waits for input of a password. If this happens I wish to timeout the session after say 10 seconds.
Cheers
David

Last edited by dmalesd on 2006-10-31 13:00; edited 1 time in total
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
dmalesd wrote:
The problem is WinSCP.com sometimes does not successfully complete key authentication and then waits for input of a password.

What does this happen?
Quote:
If this happens I wish to timeout the session after say 10 seconds.

WinSCP does not allow that.
_________________
Martin Prikryl
dmalesd
[View user's profile]

Joined: 2006-09-28
Posts: 9
prikryl wrote:
dmalesd wrote:
The problem is WinSCP.com sometimes does not successfully complete key authentication and then waits for input of a password.

What does this happen?
The problem occurs when authenticating. The WinSCP log file says access denied and then asks for a password. This leaves the WinSCP process running on my PC which I don't want to happen.
The log file also shows the same connection happening 50 seconds later (different username but same key) and this works ok.
I can send you the snippet from my log file if you wish?

The problem occurs 10-20 times over a 12 hour period where WinSCP is executed every minute by a scheduled task.

Quote:
If this happens I wish to timeout the session after say 10 seconds.

WinSCP does not allow that.

Thats a shame. Has anyone else asked for this feature?

Thanks very much for the reply.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
dmalesd wrote:
Quote:
WinSCP does not allow that.

Thats a shame. Has anyone else asked for this feature?

You are the first. I'll consider that.
_________________
Martin Prikryl
dmalesd
[View user's profile]

Joined: 2006-09-28
Posts: 9
prikryl wrote:
dmalesd wrote:
Quote:
WinSCP does not allow that.

Thats a shame. Has anyone else asked for this feature?

You are the first. I'll consider that.


Can you give me any time frame for when it can be incorporated in a release?
Thanks very much. Apart from this little problem WinSCP is working absolutely fine. Thanks.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
dmalesd wrote:
Can you give me any time frame for when it can be incorporated in a release?

I have no fixed plans for a next release, yet. Sorry Sad
_________________
Martin Prikryl
Mike W

Guest


I am using Winscp in a script and if it fails with private key it waits for a psssword input and never time out. THis caused all the rest of the process to stop. Being able to set a timeout in Winscp such that if no password is entered / no authentication within x seconds then it abandons connection would be a very welcome feature to make this a little more robust.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Mike W wrote:
I am using Winscp in a script and if it fails with private key it waits for a psssword input and never time out. THis caused all the rest of the process to stop. Being able to set a timeout in Winscp such that if no password is entered / no authentication within x seconds then it abandons connection would be a very welcome feature to make this a little more robust.

This will be added in the next release.
_________________
Martin Prikryl
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