1

I can connect to my SSH server using WinSCP from Windows and by selecting the file protocol "SCP", selecting "SFTP" does not work" for this server. I am desperately trying to do the same from Linux. I have tried the following without success:

  1. thunar file manager: "ssh://" and "sftp://"
  2. Filezilla: SFTP does not work, there is no SCP option
  3. SSHFS: I get this error during the mounting "debug1: Exit status 127, remote host has disconnected"

I can connect with SSH on the command line without any problem but I would like to be able to browse the files with a GUI. Any advice?

$ sudo sshfs -odebug,sshfs_debug,loglevel=debug root@192.168.1.10:/ /mnt/test
...
root@192.168.1.10's password:
debug1: Authentication succeeded (password).
...
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
sh: /usr/libexec/sftp-server: not found
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 1904, received 1592 bytes, in 0.1 seconds
Bytes per second: sent 35690.4, received 29841.9
debug1: Exit status 127
remote host has disconnected

Does sshfs require sftp on the other side? If yes, how does WinSCP do?

0
1

Use sshfs

test

ssh user@remote
exit

mount remote file-system

mkdir -p ssh-mount-point
sshfs user@remote:~ ssh-mount-point

Now use any file browser to look in ssh-mount-point e.g. ls ssh-mount-point

You can also change ~ to / or any other path on the remote machine (you will access all files as user).

8
  • Thanks but that is exactly what I am doing. ssh command works but not sshfs which returns "debug1: Exit status 127, remote host has disconnected". The same sshfs command works against another SSH server so now I am using the right syntax. code
    – mifrey
    Dec 12 '20 at 19:18
  • Check the settings of the server: There is a setting to enable and disable some of its services. Maybe sshfs (it may be scp) is disabled. Also what do you get if you increase verbosity? Can you also look in logs of server? Dec 13 '20 at 10:34
  • I put the command output in the initial question. I looks like it tries to use sftp. It works when I connect using WinSCP so the sever is running ok. I do not have any logs on the server but dropbear[22863]: Exit (root): Disconnect received.
    – mifrey
    Dec 13 '20 at 11:16
  • Yes it looks like it is trying to use a non-existent sftp-server. It will need installing. Dec 13 '20 at 14:00
  • Well I cannot believe that WinSCP can do something that cannot be done on Linux... my goal is not to change the server but understand what needs to be done on the client side.
    – mifrey
    Dec 13 '20 at 20:47
1

The SCP protocol does not allow you to browse the files. The SCP can copy ("CP") only = upload/download. WinSCP is kind of cheating. It uses the SCP for the file transfers only. For the rest (browsing, renaming, deleting, etc) is uses shell commands. I'm not sure there's any other application (Linux or not) that can do the same.

Quoting Wikipedia article on the topic:

As the Secure Copy Protocol implements file transfers only, GUI SCP clients are rare, as implementing it requires additional functionality (directory listing at least). For example, WinSCP defaults to the SFTP protocol. Even when operating in SCP mode, clients like WinSCP are typically not pure SCP clients, as they must use other means to implement the additional functionality (like the ls command). This in turn brings platform-dependency problems.

More comprehensive tools for managing files over SSH are SFTP clients.

Disclaimer: I wrote that part of the article back in 2005, so it's not really an independent statement. But as it survived almost unmodified since, it shows that it is true :)

See also WinSCP article about its requirements, when using the SCP protocol.

2
  • 1
    Thanks. That is the perfect answer. As explained on WinSCP webpage, "As the SCP protocol implements file transfers only, WinSCP must use other means to implement the additional functionality (like directory listing)". It is implemented in some linux programs such as Midnight Commander (manpages.debian.org/buster/mc-data/…). I tried with MC and it works :-)
    – mifrey
    Dec 15 '20 at 14:42
  • 1
    Ha this answer could not be wrong since coming from the WinSCP developer! Thanks again.
    – mifrey
    Dec 15 '20 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.