RemoteFiles icon indicating copy to clipboard operation
RemoteFiles copied to clipboard

SFTP clients should not rely on ssh commands

Open drakkan opened this issue 6 years ago • 1 comments

Describe the bug When you create a new connection and leave the path empty the default value is ~ and this result in sending an ssh exec command to the SFTP server. An SFTP server could disable exec at all and so the app hangs and don't return the list of files.

I think the code that produces this behaviour is this (not tested):

https://github.com/niklas-8/RemoteFiles/blob/master/lib/services/connection_methods.dart#L87

To Reproduce Steps to reproduce the behavior:

  1. Download and start sftpgo (https://github.com/drakkan/sftpgo). You have the same problem with any SFTP only server
  2. Create an user a try to login
  3. The file list hangs if you don't set a path in the connection page

Expected behavior An SFTP client should not rely on ssh command but only on SFTP commands. I suggest to get the current directory using the SFTP command if no path is given

drakkan avatar Oct 24 '19 17:10 drakkan

I added a workaround in sftpgo

https://github.com/drakkan/sftpgo/commit/9c4dbbc3f84caecb75331ac813ad4d71f6280325

drakkan avatar Nov 18 '19 22:11 drakkan