Go to file
Jan Palus 5f767dec5b
Fill stat info when returning cached data for readdir
Uncached and cached results for readdir were inconsistent -- the former
returned correct stat info for directory entries while the latter
didn't. That's because only names of entries were saved in cache without
stat info. In turn this leads to issues like
https://github.com/junegunn/fzf/issues/3832 since directory traversal
library (https://github.com/charlievieth/fastwalk in this case) relies
on proper stat info returned by readdir. Hence when unchached result was
returned it gave proper outcome, while with cached result it was wrong.

Cache stat info next to entry name to fix the issue. While file
attributes are saved in cache already, they use full path as key. To
avoid potentially plenty of allocations, string copying and cache
lookups to get each attr, let's keep a copy of stat struct independently
to be on the fast path.
2024-06-17 11:48:44 +02:00
.github 👷 use latest major version for actions/checkout (#289) 2023-12-22 18:05:32 +00:00
compat Fix script issues identified through shellcheck (#258) 2021-08-25 14:45:42 +02:00
test test improvements 2023-09-23 23:05:21 +10:00
utils Add support for mounting from /etc/fstab 2017-09-20 14:43:34 +01:00
.appveyor.yml Add AppVeyor CI for Cygwin 2018-08-11 10:33:42 +01:00
.dir-locals.el Added .dir-locals.el to setup correct indentation in Emacs 2017-06-19 15:18:11 -07:00
.git-blame-ignore-revs add .git-blame-ignore-revs (#261) 2021-08-30 18:08:07 +01:00
.gitignore Added build/ to gitignore. 2019-11-23 20:58:41 +00:00
.pre-commit-config.yaml Fixup whitespace and configure CI to keep it that way 2021-08-30 15:35:33 +01:00
.travis.yml Fixup whitespace and configure CI to keep it that way 2021-08-30 15:35:33 +01:00
AUTHORS Released 3.7.3 2022-05-26 14:23:35 +01:00
COPYING Update COPYING 2011-07-01 14:15:39 +02:00
ChangeLog.rst Released 3.7.3 2022-05-26 14:23:35 +01:00
README.md Update README.md 2023-09-23 22:52:14 +10:00
cache.c Fill stat info when returning cached data for readdir 2024-06-17 11:48:44 +02:00
cache.h Switch to libfuse 3.0. 2017-07-08 12:25:13 +02:00
make_release_tarball.sh Fixup whitespace and configure CI to keep it that way 2021-08-30 15:35:33 +01:00
meson.build Released 3.7.3 2022-05-26 14:23:35 +01:00
sshfs.c Implement connect to vsock. 2022-02-15 14:45:26 +11:00
sshfs.rst Merge pull request #277 from g-easy/master 2023-11-06 19:55:14 +10:00

README.md

SSHFS

About

SSHFS allows you to mount a remote filesystem using SFTP. Most SSH servers support and enable this SFTP access by default, so SSHFS is very simple to use - there's nothing to do on the server-side.

Development Status

SSHFS is shipped by all major Linux distributions and has been in production use across a wide range of systems for many years. However, at present SSHFS does not have any active, regular contributors, and there are a number of known issues (see the bugtracker).
The current maintainer continues to apply pull requests and makes regular releases, but unfortunately has no capacity to do any development beyond addressing high-impact issues. When reporting bugs, please understand that unless you are including a pull request or are reporting a critical issue, you will probably not get a response.

How to use

Once sshfs is installed (see next section) running it is very simple:

sshfs [user@]hostname:[directory] mountpoint

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. If you need to enter a password sshfs will ask for it (actually it just runs ssh which asks for the password if needed).

Also many ssh options can be specified (see the manual pages for sftp(1) and ssh_config(5)), including the remote port number (-oport=PORT)

To unmount the filesystem:

fusermount -u mountpoint

On BSD and macOS, to unmount the filesystem:

umount mountpoint

Installation

First, download the latest SSHFS release from https://github.com/libfuse/sshfs/releases. You also need libfuse 3.1.0 or newer (or a similar library that provides a libfuse3 compatible interface for your operating system). Finally, you need the Glib library with development headers (which should be available from your operating system's package manager).

To build and install, we recommend to use Meson (version 0.38 or newer) and Ninja. After extracting the sshfs tarball, create a (temporary) build directory and run Meson:

$ mkdir build; cd build
$ meson ..

Normally, the default build options will work fine. If you nevertheless want to adjust them, you can do so with the mesonconf command:

$ mesonconf                  # list options
$ mesonconf -D strip=true    # set an option

To build, test and install SSHFS, you then use Ninja (running the tests requires the py.test Python module):

$ ninja
$ python3 -m pytest test/    # optional, but recommended
$ sudo ninja install

Getting Help

If you need help, please ask on the fuse-sshfs@lists.sourceforge.net mailing list (subscribe at https://lists.sourceforge.net/lists/listinfo/fuse-sshfs).

Please report any bugs on the GitHub issue tracker at https://github.com/libfuse/sshfs/issues.

Packaging Status

Packaging status