Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > General

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2018, 08:24 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 37
[SecureCRT 8.1.4] SFTP Session to Mikrotik problem with "ls", SecureFX works.

Hi all!

I've got a problem with SFTP sessions started with "File -> Connect SFTP Session".

What we've got:

1) SecureCRT 8.1.4 on my end
2) a Mikrotik RouterOS device on the remote end, capable of SFTP.

I want to start an SFTP session to the Mikrotik box and list the contents of its filesystem.

I do "File -> Connect SFTP Session" in SecureCRT while having the required session open.

You can see what I get here:
Code:
sftp> pwd
/
sftp> ls
.
sftp> ls -la
lrwxrwxrwx 0        0               8 Oct 12, 2017 14:26 . -> /var/pckg/rw/pckg
sftp>
However if I use SecureFX to connect to it, I get this:
Code:
i Resolved RealPath: / 
< lrwxrwxrwx        8 Thu 12-Oct-2017 14:26:20 . (S)
< drwxr-xr-x      111 Thu 12-Oct-2017 14:29:57 .. (S)
< -rw-r--r--     1372 Fri 29-Dec-2017 12:45:47 alogin.html (S)
< -rw-r--r--    20987 Mon 12-Dec-2016 10:58:56 Update_English.txt (S)
< drwxr-xr-x     2048 Thu 01-Jan-1970 03:00:40 skins (S)
< -rw-------    16608 Sat 27-Aug-2016 18:29:17 rt-office_2016-08-27.rsc (S)
< drwxr-xr-x     2048 Fri 02-Jan-1970 03:00:08 user-manager1 (S)
< drwx------     2048 Thu 23-Mar-2017 11:24:09 tftp (S)
< drwx------     2048 Thu 02-Apr-2015 17:01:43 webproxy (S)
< ----------    12457 Wed 25-Oct-2017 14:46:12 rueha-log.0.txt (S)
< ----------    72412 Wed 25-Oct-2017 14:46:03 rueha-ipsec-log.0.txt (S)
< -rw-------    19548 Mon 02-Oct-2017 19:44:59 rt-office_20171002.rsc (S)
< ----------    58032 Tue 09-Jan-2018 05:44:54 log.0.txt (S)
< -rw-r--r--     2000 Wed 25-Oct-2017 17:55:04 test.bin (S)
< -rw-------    18998 Tue 27-Jun-2017 00:17:37 rt-office_2017-06-27.rsc (S)
< -rw-r--r--     5768 Wed 25-Oct-2017 17:17:56 cert_export_svy-client-cert.p12 (S)
< drwxr-xr-x     2048 Wed 10-Apr-2013 22:36:23 pub (S)
< drwxr-xr-x     2048 Wed 10-Apr-2013 22:36:23 web-proxy1 (S)
i SEND : Stat /.
That is, I can see all the files there.

Also if I connect to a Linux box, I can "ls" files fine.

Also I can "put" files to the Mikrotik box without problems and they will appear when listing files in SecureFX. That means, they get uploaded OK.
The problem is with listing the contents of the directory.

This is a trace level 9 log from the Mikrotik session:
Code:
[LOCAL] : [SEND] : 
00000000 | 00 00 00 00 00 5a 00 00 00 07 73 65 73 73 69 6f  .....Z....sessio
00000016 | 6e 00 00 00 01 40 00 00 00 00 00 80 00           n....@.......   
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 1c 0a 5b 00 00 00 01 00 00 00 03 00 28  .....[.........(
00000016 | 00 00 00 04 00 00                                ......          
 
[LOCAL] : [SEND] : 
00000000 | 5a 00 00 00 00 62 00 00 00 03 00 00 00 09 73 75  Z....b........su
00000016 | 62 73 79 73 74 65 6d 01 00 00 00 04 73 66 74 70  bsystem.....sftp
 
[LOCAL] : RECV[1]: SSH_MSG_CHANNEL_OPEN 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 0c 06 63 00 00 00 01                    .....c....      
 
[LOCAL] : [SEND] : 
00000000 | 37 00 34 00 20 5e 00 00 00 03 00 00 00 09 00 00  7.4. ^..........
00000016 | 00 05 01 00 00 00 06                             .......         
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 1c 09 5e 00 00 00 01 00 00 00 09 00 00  .....^..........
00000016 | 00 05 02 00 00 00 03                             .......         
 
[LOCAL] : [SEND] : 
00000000 | 3c 00 00 00 00 5e 00 00 00 03 00 00 00 35 00 00  <....^.......5..
00000016 | 00 31 c8 00 00 00 00 00 00 00 27 66 73 2d 6d 75  .1........'fs-mu
00000032 | 6c 74 69 70 6c 65 2d 72 6f 6f 74 73 2d 73 75 70  ltiple-roots-sup
00000048 | 70 6f 72 74 65 64 40 76 61 6e 64 79 6b 65 2e 63  ported@vandyke.c
00000064 | 6f 6d 00                                         om.             
 
[LOCAL] : [SEND] : 
00000000 | 6c 00 00 00 00 5e 00 00 00 03 00 00 00 5f 00 00  l....^......._..
00000016 | 00 5b c8 00 00 00 01 00 00 00 09 76 65 6e 64 6f  .[.........vendo
00000032 | 72 2d 69 64 00 00 00 16 56 61 6e 44 79 6b 65 20  r-id....VanDyke 
00000048 | 53 6f 66 74 77 61 72 65 2c 20 49 6e 63 2e 00 00  Software, Inc...
00000064 | 00 09 53 65 63 75 72 65 43 52 54 00 00 00 16 38  ..SecureCRT....8
00000080 | 2e 31 2e 34 20 28 78 36 34 20 62 75 69 6c 64 20  .1.4 (x64 build 
00000096 | 31 34 34 33 29 00 08 00 01 00 00 05 a3           1443)........   
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 2c 0d 5e 00 00 00 01 00 00 00 15 00 00  ...,.^..........
00000016 | 00 11 65 00 00 00 00 00 00 00 08 00 00 00 00 00  ..e.............
00000032 | 00 00 00                                         ...             
 
[LOCAL] : [SEND] : 
00000000 | 20 00 00 00 00 5e 00 00 00 03 00 00 00 0e 00 00   ....^..........
00000016 | 00 0a 07 00 00 00 00 00 00 00 01 2f              .........../    
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 2c 0d 5e 00 00 00 01 00 00 00 15 00 00  ...,.^..........
00000016 | 00 11 65 00 00 00 01 00 00 00 08 00 00 00 00 00  ..e.............
00000032 | 00 00 00                                         ...             
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 3c 09 5e 00 00 00 01 00 00 00 29 00 00  ...<.^.......)..
00000016 | 00 25 69 00 00 00 00 00 00 00 0f 00 00 00 00 00  ..i.............
00000032 | 00 08 00 00 00 00 02 00 00 00 02 00 00 41 ff 00  .............A..
00000048 | 00 00 14 00 00 00 14                             .......         
 
[LOCAL] : [SEND] : 
00000000 | 20 00 00 00 00 5e 00 00 00 03 00 00 00 0e 00 00   ....^..........
00000016 | 00 0a 11 00 00 00 00 00 00 00 01 2f              .........../    
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 3c 09 5e 00 00 00 01 00 00 00 29 00 00  ...<.^.......)..
00000016 | 00 25 69 00 00 00 00 00 00 00 0f 00 00 00 00 00  ..i.............
00000032 | 00 08 00 00 00 00 02 00 00 00 02 00 00 41 ff 00  .............A..
00000048 | 00 00 14 00 00 00 14                             .......         
 
[LOCAL] : [SEND] : 
00000000 | 1a 00 00 00 00 5e 00 00 00 03 00 00 00 0e 00 00  .....^..........
00000016 | 00 0a 10 00 00 00 00 00 00 00 01 2f              .........../    
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 7c 06 5e 00 00 00 01 00 00 00 6c 00 00  ...|.^.......l..
00000016 | 00 68 68 00 00 00 00 00 00 00 01 00 00 00 01 2f  .hh............/
00000032 | 00 00 00 36 64 72 77 78 72 77 78 72 77 78 20 20  ...6drwxrwxrwx  
00000048 | 20 31 20 30 20 30 20 20 20 20 20 20 20 20 20 20   1 0 0          
00000064 | 20 20 20 20 20 20 20 32 30 34 38 20 4a 61 6e 20         2048 Jan 
00000080 | 30 31 20 20 31 39 37 30 20 2f 00 00 00 0f 00 00  01  1970 /......
00000096 | 00 00 00 00 08 00 00 00 00 02 00 00 00 02 00 00  ................
00000112 | 41 ff 00 00 00 14 00 00 00 14                    A.........      
 
[LOCAL] : [SEND] : 
00000000 | 1c 00 00 00 00 5e 00 00 00 03 00 00 00 0f 00 00  .....^..........
00000016 | 00 0b 07 00 00 00 00 00 00 00 02 2f 2e           .........../.   
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 3c 09 5e 00 00 00 01 00 00 00 29 00 00  ...<.^.......)..
00000016 | 00 25 69 00 00 00 00 00 00 00 0f 00 00 00 00 00  ..i.............
00000032 | 00 00 08 00 00 00 00 00 00 00 00 00 00 a1 ff 59  ...............Y
00000048 | df 51 5c 59 df 51 5c                             .Q\Y.Q\         
 
[LOCAL] : [SEND] : 
00000000 | 1b 00 00 00 00 5e 00 00 00 03 00 00 00 0f 00 00  .....^..........
00000016 | 00 0b 11 00 00 00 00 00 00 00 02 2f 2e           .........../.   
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 3c 09 5e 00 00 00 01 00 00 00 29 00 00  ...<.^.......)..
00000016 | 00 25 69 00 00 00 00 00 00 00 0f 00 00 00 00 00  ..i.............
00000032 | 00 08 00 00 00 00 02 00 00 00 02 00 00 41 ff 00  .............A..
00000048 | 00 00 14 00 00 00 14                             .......         
 
[LOCAL] : [SEND] : 
00000000 | 25 00 00 00 00 5e 00 00 00 03 00 00 00 0f 00 00  .....^..........
00000016 | 00 0b 10 00 00 00 00 00 00 00 02 2f 2e           .........../.   
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 7c 06 5e 00 00 00 01 00 00 00 6c 00 00  ...|.^.......l..
00000016 | 00 68 68 00 00 00 00 00 00 00 01 00 00 00 01 2f  .hh............/
00000032 | 00 00 00 36 64 72 77 78 72 77 78 72 77 78 20 20  ...6drwxrwxrwx  
00000048 | 20 31 20 30 20 30 20 20 20 20 20 20 20 20 20 20   1 0 0          
00000064 | 20 20 20 20 20 20 20 32 30 34 38 20 4a 61 6e 20         2048 Jan 
00000080 | 30 31 20 20 31 39 37 30 20 2f 00 00 00 0f 00 00  01  1970 /......
00000096 | 00 00 00 00 08 00 00 00 00 02 00 00 00 02 00 00  ................
00000112 | 41 ff 00 00 00 14 00 00 00 14                    A.........      
 
[LOCAL] : [SEND] : 
00000000 | 5b 00 4c 00 4f 5e 00 00 00 03 00 00 00 0f 00 00  [.L.O^..........
00000016 | 00 0b 13 00 00 00 00 00 00 00 02 2f 2e           .........../.   
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 4c 07 5e 00 00 00 01 00 00 00 3b 00 00  ...L.^.......;..
00000016 | 00 37 68 00 00 00 00 00 00 00 01 00 00 00 11 2f  .7h............/
00000032 | 76 61 72 2f 70 63 6b 67 2f 72 77 2f 70 63 6b 67  var/pckg/rw/pckg
00000048 | 00 00 00 11 2f 76 61 72 2f 70 63 6b 67 2f 72 77  ..../var/pckg/rw
00000064 | 2f 70 63 6b 67 00 00 00 00                       /pckg....       
 
[LOCAL] : SEND[1]: SSH_MSG_CHANNEL_EOF 
[LOCAL] : [SEND] : 
00000000 | 00 00 00 00 00 60 00 00 00 03                    .....`....      
 
[LOCAL] : SEND[1]: channel close 
[LOCAL] : [SEND] : 
00000000 | 66 00 00 00 00 61 00 00 00 03                    f....a....      
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 2c 12 62 00 00 00 01 00 00 00 0b 65 78  ...,.b........ex
00000016 | 69 74 2d 73 74 61 74 75 73 00 00 00 00 00        it-status.....  
 
[LOCAL] : [RECV] : 
00000000 | 00 00 00 0c 06 61 00 00 00 01                    .....a....      
 
[LOCAL] : RECV[1]: channel close.
I'd be very grateful for any assistance. Thanks.
Reply With Quote
  #2  
Old 01-09-2018, 09:00 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,222
Hi vysh,

I am not sure what issue you are reporting.

This is a link, as shown in the ls output:

lrwxrwxrwx 0 0 8 Oct 12, 2017 14:26 . -> /var/pckg/rw/pckg

So, apparently, in SecureFX you have the "resolve symbolic links" option enabled per our prior discussion.

SecureCRT's SFTP tab does not have the same option/mechanism.

Are you asking for a feature request for SFTP tab to resolve symbolic links?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-09-2018, 11:23 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 37
Hi bgagnon,

I don't know what the issue is exactly, but when I connect to the same Mikrotik from a Linux box, I can see the contents:

Code:
svy@mail:~> sftp 10.10.16.85
svy@10.10.16.85's password: 
Connected to 10.10.16.85.
sftp> pwd
Remote working directory: /
sftp> ls
Update_English.txt                   alogin.html                          cert_export_svy-client-cert.p12      log.0.txt                            
pub                                  rt-office_2016-08-27.rsc             rt-office_2017-06-27.rsc             rt-office_20171002.rsc               rueha-ipsec-log.0.txt                
rueha-log.0.txt                      skins                                tftp                                 user-manager1                        web-proxy1                           
webproxy                             
sftp> bye
By the way this is not that device from our previous discussion. This one always worked with SecureFX, without first enabling the "Resolve symbolic links" setting.

If the problem is with that link, how can I navigate to it from within an SFTP tab?

Thanks.
Reply With Quote
  #4  
Old 01-09-2018, 11:26 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 37
And if I upload a file to the "empty" directory which I get into when I open the SFTP tab, the file will get uploaded and I will be able to find it among other files already present in that directory.

But I can't list the contents in an SFTP session when connecting to ANY Mikrotik device.

SecureFX works fine with or without enabling the "Resolve symbolic links" setting.
Reply With Quote
  #5  
Old 01-09-2018, 11:34 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,222
Hi vysh,

Thanks for the clarification.

What happens if you cd to "."?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #6  
Old 01-09-2018, 11:36 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 37
Code:
sftp> ls
.
sftp> ls -la
lrwxrwxrwx 0        0               8 Oct 12, 2017 14:26 . -> /var/pckg/rw/pckg
sftp> cd .
sftp> cd /var/pckg/rw/pckg
The system cannot find the file specified.
sftp>
Seems like it loops back to itself, or so it seems to me..

Code:
sftp> cd .
sftp>

Last edited by vysh; 01-09-2018 at 11:39 AM.
Reply With Quote
  #7  
Old 01-09-2018, 11:44 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 37
Putty's "psftp" client also works:

Code:
c:\Users\Vitalys>psftp svy@10.10.16.85
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 d1:53:ae:bc:40:5d:3b:19:08:34:fc:96:28:0d:c0:00
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) y
Using username "svy".
svy@10.10.16.85's password:
Remote working directory is /
psftp> ls
Listing directory /
lrwxrwxrwx   1 0 0                    8 Oct 12 11:26 .
drwxr-xr-x   5 0 0                  111 Oct 12 11:29 ..
-rw-r--r--   1 0 0                20987 Dec 12  2016 Update_English.txt
-rw-r--r--   1 0 0                 1372 Dec 29 09:45 alogin.html
-rw-r--r--   1 0 0                 2000 Oct 25 14:55 cert_export_svy-client-cert.p12
----------   1 0 0                58032 Jan 09 02:44 log.0.txt
drwxr-xr-x   1 0 0                 2048 Apr 10  2013 pub
-rw-------   1 0 0                16608 Aug 27  2016 rt-office_2016-08-27.rsc
-rw-------   1 0 0                18998 Jun 26  2017 rt-office_2017-06-27.rsc
-rw-------   1 0 0                19548 Oct 02 16:44 rt-office_20171002.rsc
----------   1 0 0                72412 Oct 25 11:46 rueha-ipsec-log.0.txt
----------   1 0 0                12457 Oct 25 11:46 rueha-log.0.txt
drwxr-xr-x   1 0 0                 2048 Jan 01  1970 skins
drwx------   1 0 0                 2048 Mar 23  2017 tftp
drwxr-xr-x   1 0 0                 2048 Jan 02  1970 user-manager1
drwxr-xr-x   1 0 0                 2048 Apr 10  2013 web-proxy1
drwx------   1 0 0                 2048 Apr 02  2015 webproxy
psftp> bye

c:\Users\Vitalys>
Reply With Quote
  #8  
Old 01-09-2018, 11:45 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,222
Hi vysh,

Odd, I think we need to get a complete log (level 9) from SecureFX.

Could you send that to support@vandyke.com and reference "Attn Brenda - Forum Thread #12973"?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #9  
Old 01-09-2018, 11:57 AM
vysh vysh is offline
Registered User
 
Join Date: Oct 2014
Posts: 37
I just did. Thanks.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:15 AM.