|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I'm a SFTP newbie.
I'm trying to use VSFTP (VShell 4.0.4 (x64 build 636) to connect to a 3rd party SFTP, change to a particular remote folder and then list files and if it matches a regular expression, download those files. This process occurs perfectly if I test (using the same SFTP server) and WinSCP, however with VSFTP (which I'm not using in isolation but by way of a suite called Hedwig which allows us to control FTP jobs and so forth) it connects to the 3rd party, shows attempts to change folder, but then moments later ends the connection, having detected no files and therefore matching no files. I'll say at this point that we have 3rd party SFTP exchanges with many other parties successfully - both internal servers of our own and with 3rd parties. This is a NEW partner I'm talking about and i'm very new to the technology itself. Looking at the verbose logs my suite generates, I see what looks like a successfully-authenticated session, a "CHANGE-PATH" statement attempting to change to the local subfolder called "in" on the remote server, but seemingly nothing else before the session is closed. Here is an excerpt of some of the verbose logging the SFTP suite I'm using generates, I'm not sure if this is native VSFTP logging or not. I've bolded some lines I think are relevant: 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : AUTH_SUCCESS 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV[0]: SSH_MSG_CHANNEL_OPEN 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Server Sftp Version: 6 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SERVER-SUPPORTED-VERSIONS: 1,2,3,4,5,6 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : VENDOR-NAME: Extenua 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : PRODUCT-NAME: SilverSHielD SSH2/SFTP Server 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : PRODUCT-VERSION: 6.0.0 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : PRODUCT-BUILD: 0000000000000000 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : fs-multiple-roots-supported request[Off] 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : vendor-id request 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Status 8, Text: Unsupported extension 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : fs-multiple-roots-supported reply: 8 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Status 0, Text: 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : RealPath, base=. 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : change-path=/in 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Names, count 1 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : OpenDir / 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Handle[1b5b6d70] 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : Readdir[1b5b6d70] 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Names, count 4 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : SEND : Close[1b5b6d70] 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : RECV : Status 0, Text: 1/07/2019 3:23:05 PM,2004,25,[LOCAL] : Changing state from STATE_CONNECTION to STATE_TRANSPORT_STOPPING Trying the same process but using WinSCP, which we have purely for testing purposes, it generates a far different log, but shows events like: ! 2019-07-01 15:19:22.569 Using username "SomeUserName". . 2019-07-01 15:19:22.584 Server offered these authentication methods: password,publickey . 2019-07-01 15:19:22.584 Offered public key . 2019-07-01 15:19:22.834 Offer of public key accepted ! 2019-07-01 15:19:22.834 Authenticating with public key "imported-openssh-key" . 2019-07-01 15:19:22.896 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "imported-openssh-key": ") . 2019-07-01 15:19:26.344 Sent public key signature . 2019-07-01 15:19:26.578 Access granted ... . 2019-07-01 15:19:26.718 Using SFTP protocol. . 2019-07-01 15:19:26.718 Doing startup conversation with host. ... . 2019-07-01 15:19:26.796 SFTP versions supported by the server: 1,2,3,4,5,6 . 2019-07-01 15:19:26.796 Server software: SilverSHielD SSH2/SFTP Server 6.0.0 (0) by Extenua > 2019-07-01 15:19:26.796 Type: SSH_FXP_EXTENDED, Size: 63, Number: 200 < 2019-07-01 15:19:26.796 Type: SSH_FXP_STATUS, Size: 17, Number: 200 . 2019-07-01 15:19:26.796 We will use UTF-8 strings as it is mandatory with SFTP version 4 and newer . 2019-07-01 15:19:26.796 Getting current directory name. . 2019-07-01 15:19:26.812 Getting real path for '.' > 2019-07-01 15:19:26.812 Type: SSH_FXP_REALPATH, Size: 11, Number: 272 < 2019-07-01 15:19:26.828 Type: SSH_FXP_NAME, Size: 91, Number: 272 . 2019-07-01 15:19:26.828 Real path is '/' . 2019-07-01 15:19:27.030 Listing directory "/". > 2019-07-01 15:19:27.030 Type: SSH_FXP_OPENDIR, Size: 10, Number: 523 < 2019-07-01 15:19:27.046 Type: SSH_FXP_HANDLE, Size: 13, Number: 523 > 2019-07-01 15:19:27.046 Type: SSH_FXP_READDIR, Size: 13, Number: 780 < 2019-07-01 15:19:27.062 Type: SSH_FXP_NAME, Size: 332, Number: 780 > 2019-07-01 15:19:27.062 Type: SSH_FXP_READDIR, Size: 13, Number: 1036 > 2019-07-01 15:19:27.077 Type: SSH_FXP_CLOSE, Size: 13, Number: 1284 . 2019-07-01 15:19:27.077 archive;D;0;2019-05-21T05:56:46.000Z;3;"user" [0];"group" [0];r--r--r--;0 . 2019-07-01 15:19:27.077 in;D;0;2019-06-30T18:27:10.000Z;3;"user" [0];"group" [0];r--r--r--;0 . 2019-07-01 15:19:27.077 out;D;0;2019-06-27T02:29:13.000Z;3;"user" [0];"group" [0];r--r--r--;0 . 2019-07-01 15:19:27.077 ..;D;0;1899-12-30T11:00:00.000Z;0;"" [0];"" [0];---------;0 . 2019-07-01 15:19:27.155 Startup conversation with host finished. . 2019-07-01 15:19:29.963 Cached directory change via "in" to "/in". . 2019-07-01 15:19:29.963 Getting current directory name. . 2019-07-01 15:19:29.963 Listing directory "/in". > 2019-07-01 15:19:29.963 Type: SSH_FXP_OPENDIR, Size: 12, Number: 1547 < 2019-07-01 15:19:29.963 Type: SSH_FXP_STATUS, Size: 25, Number: 1036 . 2019-07-01 15:19:29.963 Discarding reserved response < 2019-07-01 15:19:29.963 Type: SSH_FXP_STATUS, Size: 17, Number: 1284 . 2019-07-01 15:19:29.963 Discarding reserved response < 2019-07-01 15:19:29.979 Type: SSH_FXP_HANDLE, Size: 13, Number: 1547 > 2019-07-01 15:19:29.979 Type: SSH_FXP_READDIR, Size: 13, Number: 1804 < 2019-07-01 15:19:29.994 Type: SSH_FXP_NAME, Size: 2818, Number: 1804 > 2019-07-01 15:19:29.994 Type: SSH_FXP_READDIR, Size: 13, Number: 2060 > 2019-07-01 15:19:29.994 Type: SSH_FXP_CLOSE, Size: 13, Number: 2308 . 2019-07-01 15:19:29.994 ..;D;0;2019-06-30T18:27:10.000Z;3;"user" [0];"group" [0];r--r--r--;0 . 2019-07-01 15:19:29.994 SomeFiles.csv;-;4;2019-06-27T02:06:54.000Z;3;"user" [0];"group" [0];rw-rw-rw-;1 . 2019-07-01 15:19:33.567 Copying 1 files/directories to local directory "SomeDirectory" Note: Obviously I've changed some lines for privacy. Note, the SFTP automation suite we use, which utilises VSFTP and has done so for several years very successfully, involves me providing a regular expression as a means of matching with remote files. I've experimented with my regular expression, running it past other tech support staff, successfully testing it on one of the many regular expression testing websites, I've even stripped my regular expression back to very generalised search. Whilst I realise a regular expression is a place where this process could fail, I don't think it is getting as far as matching or not matching my regex at all, it's like the attempts I'm making to switch to the '/in' remote folder are itself not being processed and therefore I'm not getting a list of files at all. I realise this is a lot of information, but any information or tips much appreciated. |
Tags |
files , hedwig , sftp , vshell |
Thread Tools | |
Display Modes | |
|
|