How to mount sftp server with sshfs

It is simple enough to connect sftp server with lftp command without any key or password :

lftp  192.168.31.130:3721
lftp 192.168.31.130:~> ls
drwxr-xr-x 1 nobody nobody         3488 Dec 22 20:17 Android
drwxr-xr-x 1 nobody nobody         3488 Jul 29 00:43 MIUI

Now I want to mount the sftp server with sshfs:

sudo sshfs  192.168.31.130:3721  /tmp/localdir
read: Connection reset by peer
sudo sshfs  192.168.31.130:3721  /tmp/localdir  -o allow_other
read: Connection reset by peer

How can I mount sftp server with sshfs ?

More info on 192.168.31.130:3721.
I installed ES File Explorer on my android phone,and activate function "view on pc",3721 is port ,the protocol is FTP,start the FTP server using ES File Explorer on my android phone.

enter image description here

Asked By: showkey

||

SFTP and FTP are totally unrelated protocols. You cannot run an sshfs client on top of an FTP service.

In the documentation, man sshfs, the section DESCRIPTION writes

SSHFS allows you to mount a remote filesystem using SSH (more precisely, the SFTP subsystem).

It goes on to say,

It is recommended to run SSHFS as regular user (not as root). For this to work the mountpoint must be owned by the user. If username is omitted SSHFS will use the local username. If the directory is omitted, SSHFS will mount the (remote) home directory.

Answered By: Chris Davies
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.