Topic "WinSCP treats normal file as directory when using SFTP"

Author Message
moudy

Guest


Hello,

I have a problem while using WinSCP to access remote file with SFTP(V2) protocol.
The login process is trouble-free. But if I double-click a normal file on remote side, e.g. "erlang.pdf". WinSCP seems to treat this file as a directory, and wants to go into. This behaviour will centainly cause an error with code 2 -- No such file or directory.

If I right click the file, <Open> and <Edit> command are not in bold, which means not a default action. If one of them is selected manually, the behavior is totally normal.

If I connect the server with SCP, the problem is gone. (But SCP protocol spends more time on login, so I prefer SFTP.)

There are 4 servers in my local network. This issue happens on two of them. The other two have no such problem.

So I think it's strange, but don't know who is doing things wrong, server or client? If it's client, I think the problem is probably not in network level but GUI level.

I'm using WinSCP 4.2.1 (Build 428).
This problem appears under XP(SP3 x86), Vista(Ultimate x64), Win7(RC 7100 x86).

Below is the log file created by level "normal".

Any suggestion is welcome!

Best wishes
Moudy

Code:

--------------------------------------------------------------------------
WinSCP Version 4.2.1 (Build 428) (OS 6.1.7100)
Login time: Saturday, June 06, 2009 11:17:47 PM
--------------------------------------------------------------------------
Session name: XXXXXXXXXXXXXXXXXXXX
Host name: XXXXXXXXXXXXXXXXXXXX (Port: 22)
User name: XXXXXXXXXXXXXXXXXXXX (Password: No, Key file: Yes)
Tunnel: No
Transfer Protocol: SFTP (SCP)
Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
Proxy: none
SSH protocol version: 2; Compression: No
Bypass authentication: No
Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
SSH Bugs: -,-,-,-,-,-,-,-,-
SFTP Bugs: -,-
Return code variable: Autodetect; Lookup user groups: Yes
Shell: default, EOL: 0
Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
Local directory: D:\Users\XXXXXXXXXXXXXXXXXXXX\Documents, Remote directory: /home/XXXXXXXXXXXXXXXXXXXX, Update: No, Cache: Yes
Cache directory changes: Yes, Permanent: Yes
DST mode: 1
--------------------------------------------------------------------------
Looking up host "XXXXXXXXXXXXXXXXXXXX"
Connecting to XXXXXXXXXXXXXXXXXXXX port 22
Server version: SSH-2.0-Sun_SSH_1.0.1
We believe remote version has SSH-2 rekey bug
Using SSH protocol version 2
We claim version: SSH-2.0-WinSCP_release_4.2.1
Using Diffie-Hellman with standard group "group1"
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-rsa 1024 75:c4:5f:XXXXXXXXXXXXXXXXXXXX:3c:aa
Initialised AES-128 CBC client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-128 CBC server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Reading private key file "XXXXXXXXXXXXXXXXXXXX.ppk"
Using username "XXXXXXXXXXXXXXXXXXXX".
Offered public key
Offer of public key accepted
Authenticating with public key "XXXXXXXXXXXXXXXXXXXX"
Access granted
Opened channel for session
Started a shell/command
--------------------------------------------------------------------------
Using SFTP protocol.
Doing startup conversation with host.
Type: SSH_FXP_INIT, Size: 5, Number: -1
Type: SSH_FXP_VERSION, Size: 5, Number: -1
SFTP version 2 negotiated.
We believe the server has signed timestamps bug
We will use UTF-8 strings for status messages only
Changing directory to "/home/XXXXXXXXXXXXXXXXXXXX".
Getting real path for '/home/XXXXXXXXXXXXXXXXXXXX'
Type: SSH_FXP_REALPATH, Size: 18, Number: 16
Type: SSH_FXP_NAME, Size: 39, Number: 16
Real path is '/home/XXXXXXXXXXXXXXXXXXXX'
Trying to open directory "/home/XXXXXXXXXXXXXXXXXXXX".
Type: SSH_FXP_LSTAT, Size: 18, Number: 263
Type: SSH_FXP_ATTRS, Size: 37, Number: 263
Getting current directory name.
Listing directory "/home/XXXXXXXXXXXXXXXXXXXX".
Type: SSH_FXP_OPENDIR, Size: 18, Number: 523
Type: SSH_FXP_HANDLE, Size: 13, Number: 523
Type: SSH_FXP_READDIR, Size: 13, Number: 780
Type: SSH_FXP_NAME, Size: 11007, Number: 780
Type: SSH_FXP_READDIR, Size: 13, Number: 1036
Type: SSH_FXP_STATUS, Size: 9, Number: 1036
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 1284
Startup conversation with host finished.
[color=red]Changing directory to "erlang.pdf".
Getting real path for '/home/XXXXXXXXXXXXXXXXXXXX/erlang.pdf'[/color]
Type: SSH_FXP_REALPATH, Size: 29, Number: 1552
Type: SSH_FXP_STATUS, Size: 9, Number: 1284
Discarding reserved response
Type: SSH_FXP_NAME, Size: 61, Number: 1552
Real path is '/home/XXXXXXXXXXXXXXXXXXXX/erlang.pdf'
Trying to open directory "/home/XXXXXXXXXXXXXXXXXXXX/erlang.pdf".
Type: SSH_FXP_LSTAT, Size: 29, Number: 1799
Type: SSH_FXP_ATTRS, Size: 37, Number: 1799
Getting current directory name.
Listing directory "/home/XXXXXXXXXXXXXXXXXXXX/erlang.pdf".
Type: SSH_FXP_OPENDIR, Size: 29, Number: 2059
Type: SSH_FXP_STATUS, Size: 9, Number: 2059
Status/error code: 2, Message: 2059, Server: None, Language: 
(ECommand) Error listing directory '/home/XXXXXXXXXXXXXXXXXXXX/erlang.pdf'.
No such file or directory.
Error code: 2
Error message from server: None
Request code: 11
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The problem is that your server supports only version 2 of the SFTP protocol. With this version WinSCP is not able to tell if file is regular file or symlink to directory. As symlinks to directories are very common, WinSCP always tries to open file as directory when double-clicked. This is discussed in documentation.
Note that SFTP-2 is very obsolete and rare. Actually I've never seen myself a server that uses it.

Quote:
But SCP protocol spends more time on login, so I prefer SFTP.

Try to disable Clear national variables, Clear aliases and Lookup user groups on SCP tab of login dialog.
moudy

Guest


Thanks for your explanation and suggestion. Now the SCP login connect really fast.

BTW the two servers are gateways to other sub networks. Our admin applied the oldest configurations on it for maximal stability. Sad
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