Scripting: Login problem when not using Puttyagent

Advertisement

DGorthat
Joined:
Posts:
15

Scripting: Login problem when not using Puttyagent

Hello

We are using winsftp.com for several automated sftp filetransfers. This works stable and reliable since months.
These are running in a windows service in the backround process on a windows 2000 machine.
That service creates a .cmd file and the winscp script file in a temporary directory and executes them.
WinSCP.exe ist setup to store the configuration in its .ini file so that even the keys are reachable
for the winscp.com executable.
This configuration works for 9 diferent hosts since months with no problems.

Running sftp scripting in a windows service runs into a login problem on one server.
The service is logged in with the same account as the windosw user I am testing the connection with WinSCP.exe.
Login with WinSCP.exe works and I can send and receive files.
But even when I try to use WinSCP.com manually I get the following log directly after entering the username:
batch        on        
confirm      off       
Suche nach entferntem Rechner...
Verbinde mit entferntem Rechner...
Authentifiziere...
Verwende Benutzername "xxx".
No supported authentication methods left to try!
Die Verbindung wurde unerwartet geschlossen. Der Server sendete den Befehlsbeendigungsstatus 0.
Anmeldungsprotokoll (Siehe Sitzungsprotokoll für Details):
Verwende Benutzername "tcc".
No supported authentication methods left to try!


Anmeldung fehlgeschlagen.
Keine Sitzung
That is the same result I get in the log, when I run the service.
But:

When I use Puttyagent to enter the key into it, I am able to log on to that host with winscp.com manualy.
The service is running under the same windows account is still not able to connect and leads to the same error (see above).
I assume winsftp.com is not able to connect to the pageant.exe because it is another session.

We are running 4.07 Build 370

Thanks in advance for any comment

Dirk

Reply with quote

Advertisement

DGorthat
Joined:
Posts:
15

Re: Scripting: Login problem when not using Puttyagent

Thank you for your quick response.

This is the log of winscp.exe succeeding the conection. Pagent ist still running from the tests before. It has no keys inserted.

My problem for testing winsft with diffrent versions is that that computer is the only one in our network with full access to the required ports.

If there is no idea what to do the next step will be to update to the newes version of winscp.
. 2009-03-02 10:32:52.403 --------------------------------------------------------------------------
. 2009-03-02 10:32:52.403 WinSCP Version 4.0.7 (Build 370) (OS 5.0.2195 Service Pack 4)
. 2009-03-02 10:32:52.403 Login time: Montag, 2. März 2009 10:32:52
. 2009-03-02 10:32:52.419 --------------------------------------------------------------------------
. 2009-03-02 10:32:52.419 Session name: xxx@000.000.000.000_xxxxxxxxxxxx
. 2009-03-02 10:32:52.419 Host name: 000.000.000.000 (Port: 22)
. 2009-03-02 10:32:52.419 User name: xxx (Password: Yes, Key file: Yes)
. 2009-03-02 10:32:52.419 Tunnel: No
. 2009-03-02 10:32:52.419 Transfer Protocol: SFTP (SCP)
. 2009-03-02 10:32:52.419 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2009-03-02 10:32:52.419 Proxy: none
. 2009-03-02 10:32:52.419 SSH protocol version: 2; Compression: No
. 2009-03-02 10:32:52.419 Agent forwarding: Yes; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2009-03-02 10:32:52.419 Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
. 2009-03-02 10:32:52.419 SSH Bugs: -,-,-,-,-,-,-,-
. 2009-03-02 10:32:52.419 SFTP Bugs: -,-,-
. 2009-03-02 10:32:52.419 Return code variable: Autodetect; Lookup user groups: Yes
. 2009-03-02 10:32:52.419 Shell: default, EOL: 0
. 2009-03-02 10:32:52.419 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2009-03-02 10:32:52.419 Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
. 2009-03-02 10:32:52.419 Local directory: D:\TxdRxd, Remote directory: /svc/home, Update: No, Cache: Yes
. 2009-03-02 10:32:52.419 Cache directory changes: Yes, Permanent: Yes
. 2009-03-02 10:32:52.419 DST mode: 1
. 2009-03-02 10:32:52.419 --------------------------------------------------------------------------
. 2009-03-02 10:32:52.434 Looking up host "000.000.000.000"
. 2009-03-02 10:32:52.434 Connecting to 000.000.000.000 port 22
. 2009-03-02 10:32:52.528 Server version: SSH-1.99-OpenSSH_4.2
. 2009-03-02 10:32:52.528 We claim version: SSH-2.0-WinSCP_release_4.0.7
. 2009-03-02 10:32:52.528 Using SSH protocol version 2
. 2009-03-02 10:32:52.575 Doing Diffie-Hellman group exchange
. 2009-03-02 10:32:52.669 Doing Diffie-Hellman key exchange
. 2009-03-02 10:32:53.013 Host key fingerprint is:
. 2009-03-02 10:32:53.013 ssh-rsa 1024 c9:62:0b:41:83:68:88:82:bf:29:1f:75:dc:8d:00:d9
. 2009-03-02 10:32:53.013 Initialised AES-256 client->server encryption
. 2009-03-02 10:32:53.013 Initialised HMAC-SHA1 client->server MAC algorithm
. 2009-03-02 10:32:53.013 Initialised AES-256 server->client encryption
. 2009-03-02 10:32:53.013 Initialised HMAC-SHA1 server->client MAC algorithm
! 2009-03-02 10:32:53.075 Using username "xxx".
. 2009-03-02 10:32:53.075 Reading private key file "D:\sFTP-Keys\xxx_private2.ppk"
. 2009-03-02 10:32:53.091 Pageant is running. Requesting keys.
. 2009-03-02 10:32:53.091 Pageant has 0 SSH-2 keys
. 2009-03-02 10:32:53.091 Offered public key
. 2009-03-02 10:32:53.106 Offer of public key accepted
! 2009-03-02 10:32:53.106 Authenticating with public key "xxx"
. 2009-03-02 10:32:53.278 Access granted
. 2009-03-02 10:32:53.294 Opened channel for session
. 2009-03-02 10:32:53.294 Requesting OpenSSH-style agent forwarding
. 2009-03-02 10:32:53.294 Agent forwarding enabled
. 2009-03-02 10:32:53.309 Started a shell/command
. 2009-03-02 10:32:53.309 --------------------------------------------------------------------------
. 2009-03-02 10:32:53.309 Using SFTP protocol.
. 2009-03-02 10:32:53.309 Doing startup conversation with host.
> 2009-03-02 10:32:53.325 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-03-02 10:32:53.325 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-03-02 10:32:53.325 SFTP version 3 negotiated.
. 2009-03-02 10:32:53.325 We believe the server has signed timestamps bug
. 2009-03-02 10:32:53.325 We will use UTF-8 strings for status messages only
. 2009-03-02 10:32:53.325 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-03-02 10:32:53.325 Changing directory to "/svc/home/kds_rueckf/Outbox/vp/xxx".
. 2009-03-02 10:32:53.325 Getting real path for '/svc/home/kds_rueckf/Outbox/vp/xxx'
> 2009-03-02 10:32:53.325 Type: SSH_FXP_REALPATH, Size: 43, Number: 16
< 2009-03-02 10:32:53.341 Type: SSH_FXP_NAME, Size: 89, Number: 16
. 2009-03-02 10:32:53.341 Real path is '/svc/home/kds_rueckf/Outbox/vp/xxx'
. 2009-03-02 10:32:53.341 Trying to open directory "/svc/home/kds_rueckf/Outbox/vp/xxx".
> 2009-03-02 10:32:53.341 Type: SSH_FXP_LSTAT, Size: 43, Number: 263
< 2009-03-02 10:32:53.356 Type: SSH_FXP_ATTRS, Size: 37, Number: 263
. 2009-03-02 10:32:53.356 Getting current directory name.
. 2009-03-02 10:32:53.356 Listing directory "/svc/home/kds_rueckf/Outbox/vp/xxx".
> 2009-03-02 10:32:53.356 Type: SSH_FXP_OPENDIR, Size: 43, Number: 523
< 2009-03-02 10:32:53.356 Type: SSH_FXP_HANDLE, Size: 13, Number: 523
> 2009-03-02 10:32:53.356 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2009-03-02 10:32:54.247 Type: SSH_FXP_NAME, Size: 8705, Number: 780
> 2009-03-02 10:32:54.247 Type: SSH_FXP_READDIR, Size: 13, Number: 1036
< 2009-03-02 10:32:54.263 Type: SSH_FXP_STATUS, Size: 28, Number: 1036
< 2009-03-02 10:32:54.263 Status/error code: 1
> 2009-03-02 10:32:54.263 Type: SSH_FXP_CLOSE, Size: 13, Number: 1284
. 2009-03-02 10:32:54.263 Startup conversation with host finished.
. 2009-03-02 10:33:26.794 Closing connection.
Thanks

Dirk

Reply with quote

DGorthat
Joined:
Posts:
15

OK,

I updateted to 4.1.8 with the same result.
. 2009-03-02 15:27:29.602 --------------------------------------------------------------------------
. 2009-03-02 15:27:29.602 WinSCP Version 4.1.8 (Build 415) (OS 5.0.2195 Service Pack 4)
. 2009-03-02 15:27:29.602 Login time: Montag, 2. März 2009 15:27:29
. 2009-03-02 15:27:29.602 --------------------------------------------------------------------------
. 2009-03-02 15:27:29.602 Session name: xxx@xxx.xxx.xxx.xxx
. 2009-03-02 15:27:29.602 Host name: xxx.xxx.xxx.xxx (Port: 22)
. 2009-03-02 15:27:29.602 User name: xxx (Password: Yes, Key file: No)
. 2009-03-02 15:27:29.602 Tunnel: No
. 2009-03-02 15:27:29.602 Transfer Protocol: SFTP (SCP)
. 2009-03-02 15:27:29.602 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2009-03-02 15:27:29.602 Proxy: none
. 2009-03-02 15:27:29.602 SSH protocol version: 2; Compression: No
. 2009-03-02 15:27:29.602 Bypass authentication: No
. 2009-03-02 15:27:29.602 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2009-03-02 15:27:29.602 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2009-03-02 15:27:29.602 SSH Bugs: -,-,-,-,-,-,-,-
. 2009-03-02 15:27:29.602 SFTP Bugs: -,-
. 2009-03-02 15:27:29.602 Return code variable: Autodetect; Lookup user groups: Yes
. 2009-03-02 15:27:29.602 Shell: default, EOL: 0
. 2009-03-02 15:27:29.602 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2009-03-02 15:27:29.602 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2009-03-02 15:27:29.602 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2009-03-02 15:27:29.602 Cache directory changes: Yes, Permanent: Yes
. 2009-03-02 15:27:29.602 DST mode: 1
. 2009-03-02 15:27:29.602 --------------------------------------------------------------------------
. 2009-03-02 15:27:29.602 Looking up host "xxx.xxx.xxx.xxx"
. 2009-03-02 15:27:29.602 Connecting to xxx.xxx.xxx.xxx port 22
. 2009-03-02 15:27:29.648 Server version: SSH-1.99-OpenSSH_4.2
. 2009-03-02 15:27:29.648 We claim version: SSH-2.0-WinSCP_release_4.1.8
. 2009-03-02 15:27:29.664 AcquireCredentialsHandle: Im Sicherheitspaket sind keine Anmeldeinformationen verf�gbar.
. 2009-03-02 15:27:29.664 GSSKEX disabled: Der Vorgang wurde erfolgreich beendet.
. 2009-03-02 15:27:29.664 Using SSH protocol version 2
. 2009-03-02 15:27:29.664 Doing Diffie-Hellman group exchange
. 2009-03-02 15:27:29.711 Doing Diffie-Hellman key exchange with hash SHA-1
. 2009-03-02 15:27:29.945 Host key fingerprint is:
. 2009-03-02 15:27:29.945 ssh-rsa 1024 c9:62:0b:41:83:68:88:82:bf:29:1f:75:dc:8d:00:d9
. 2009-03-02 15:27:29.945 Initialised AES-256 SDCTR client->server encryption
. 2009-03-02 15:27:29.945 Initialised HMAC-SHA1 client->server MAC algorithm
. 2009-03-02 15:27:29.945 Initialised AES-256 SDCTR server->client encryption
. 2009-03-02 15:27:29.945 Initialised HMAC-SHA1 server->client MAC algorithm
! 2009-03-02 15:27:30.008 Using username "xxx".
. 2009-03-02 15:27:30.023 Disconnected: No supported authentication methods available
Connecting with winscp.exe still works.

Thank you for any comment

Dirk

Reply with quote

martin
Site Admin
martin avatar

I'm still bit confused by the description of the problem. Thought, to me it looks like the server has only private key authentication allowed. And as you have not specified any key, nor running pagent, the authentication fails. Would it explain your issue?

Reply with quote

Advertisement

DGorthat
Joined:
Posts:
15

Hello Martin

thanks for the replay.

When I start winscp.exe from the desctop I am able to connect and send and receive files. (just using the key stored in the .ini file)

When I start winscp.com from the desctop in a commandshell just using the same settings and key as winscp.exe I get the message "No supported authentication methods available" as mentioned before after entering the username.

When I start Pagent, enter the key into it and start winscp.com from the desktop in a commandshell it is able to connect and send / receive files.

The target is that the winscp is called by a windows service in the background. Unfortunatly it is not able to connect to the Pagent.exe. Currently all other connections work and are using the keys stored in the ini file of winscp.

I hope my problem is a bit more clearer now.

Thank you

Dirk

Reply with quote

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

DGorthat wrote:

When I start winscp.exe from the desctop I am able to connect and send and receive files. (just using the key stored in the .ini file)

When I start winscp.com from the desctop in a commandshell just using the same settings and key as winscp.exe I get the message "No supported authentication methods available" as mentioned before after entering the username.

In the log file showing unsuccessful connection, there were no key:
. 2009-03-02 15:27:29.602 User name: xxx (Password: Yes, Key file: No)
...
. 2009-03-02 15:27:30.023 Disconnected: No supported authentication methods available

So that may be an answer.

Reply with quote

DGorthat
Joined:
Posts:
15

Hello,

thank you for your reply.

When I add the /privatekey=... option to the commandline the connection is established.

It looks as if the .com in this special cace does not recognize the PublicKeyFile setting in the WinSCP.ini

I will let you know when I find anything

Dirk

Reply with quote

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

DGorthat wrote:

It looks as if the .com in this special cace does not recognize the PublicKeyFile setting in the WinSCP.ini

I will let you know when I find anything
Well it does.
So please let me know if you find anything new.

Reply with quote

Advertisement

You can post new topics in this forum