#kde #ssh #sshfs

Working over the net using SSHFS

Kio Slaves has a problem with working over the fish:// protocol on non standard port. The best alternative for Kio is sshfs. You can find information about the installation and configuration of FUSE filesystems on Gentoo Wiki.

Usage of sshfs

Basic usage:

sshfs -pXXXX -o [options] user@remotehost:/remote/path /local/path/

Useful options:

-pXXXXX – tells sshfs to use port number XXXXX.

-o Ciphers=arcfour – speeds up for the connection.

-o ro – read only.

-o nonempty – allow nonempty mount point.

-o cache_timeout=N – set default cache timeout (in seconds)

-o cache=no – disable cache.

-o intr – allows to interrupt file access.

-o reconnect – automatically reconnect

-o idmap=user – helps with file ownership conflicts

Optimized:

sshfs -pXXXXX -o Ciphers=arcfour,idmap=user  user@remotehost:/remote/path /local/path/

Reverse – mount local files system on remote host:

user@localhost  > ssh -R 2222:localhost:22 user@remotehost
  user@remotehost > sshfs -p 2222 localhost:/media/usb1 myusb1

File ownership:

-o idmap=user – translates the user ID of the connecting user

-o uid=UID – use as the user identifiers on the client.

-o gid=GID – use as the group identifiers on the client.

Problems

If You get an error: read: Connection reset by peer. Try using the -p options because You are probably trying to connect to the wrong port.

If the mounted sshfs gets stuck after some time of usage try adding to Yours .ssh/config

ServerAliveInterval 15

When normal unmount isn’t working try:

fusermount -uz ~/path/to/fs

sshfs file transfer schema

Image: www.scoop.it

More fascinating information on the sshfs can be found int this faq